(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 7.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[    209659,       5033]
NotebookOptionsPosition[    206279,       4918]
NotebookOutlinePosition[    206640,       4934]
CellTagsIndexPosition[    206597,       4931]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["Online Ordinal Label Extraction", "Section",
 CellChangeTimes->{{3.5259870522347393`*^9, 3.525987056087652*^9}}],

Cell[CellGroupData[{

Cell["Likelihood", "Subsection",
 CellChangeTimes->{{3.5259871234156446`*^9, 3.525987128101921*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "polytomousrasch", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"polytomousrasch", "[", 
    RowBox[{"0", ",", " ", "\[Beta]_", ",", " ", "\[Tau]_"}], "]"}], " ", ":=",
    " ", 
   RowBox[{"1", " ", "/", " ", 
    RowBox[{"(", 
     RowBox[{"1", " ", "+", " ", 
      RowBox[{"Sum", "[", 
       RowBox[{
        RowBox[{"Exp", "[", 
         RowBox[{"Sum", "[", 
          RowBox[{
           RowBox[{"\[Beta]", " ", "-", " ", 
            RowBox[{"\[Tau]", "[", 
             RowBox[{"[", "k", "]"}], "]"}]}], ",", " ", 
           RowBox[{"{", " ", 
            RowBox[{"k", ",", " ", "1", ",", " ", "y"}], " ", "}"}]}], "]"}], 
         "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"y", ",", " ", "1", ",", " ", 
          RowBox[{"Length", "[", "\[Tau]", "]"}]}], "}"}]}], "]"}]}], 
     ")"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"polytomousrasch", "[", 
    RowBox[{"x_", ",", " ", "\[Beta]_", ",", " ", "\[Tau]_"}], " ", "]"}], 
   " ", ":=", " ", 
   RowBox[{
    RowBox[{"Exp", "[", 
     RowBox[{"Sum", "[", 
      RowBox[{
       RowBox[{"\[Beta]", " ", "-", " ", 
        RowBox[{"\[Tau]", "[", 
         RowBox[{"[", "k", "]"}], "]"}]}], ",", " ", 
       RowBox[{"{", " ", 
        RowBox[{"k", ",", " ", "1", ",", " ", "x"}], " ", "}"}]}], "]"}], 
     "]"}], " ", "/", " ", 
    RowBox[{"(", 
     RowBox[{"1", " ", "+", " ", 
      RowBox[{"Sum", "[", 
       RowBox[{
        RowBox[{"Exp", "[", 
         RowBox[{"Sum", "[", 
          RowBox[{
           RowBox[{"\[Beta]", " ", "-", " ", 
            RowBox[{"\[Tau]", "[", 
             RowBox[{"[", "k", "]"}], "]"}]}], ",", " ", 
           RowBox[{"{", " ", 
            RowBox[{"k", ",", " ", "1", ",", " ", "y"}], " ", "}"}]}], "]"}], 
         "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"y", ",", " ", "1", ",", " ", 
          RowBox[{"Length", "[", "\[Tau]", "]"}]}], "}"}]}], "]"}]}], 
     ")"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "dlogprdbeta", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"dlogprdbeta", "[", 
    RowBox[{"0", ",", " ", "\[Beta]_", ",", " ", "\[Tau]_"}], "]"}], " ", ":=",
    " ", 
   RowBox[{
    RowBox[{"D", "[", 
     RowBox[{
      RowBox[{"Log", "[", 
       RowBox[{"polytomousrasch", "[", 
        RowBox[{"0", ",", " ", "z", ",", " ", "\[Tau]"}], "]"}], "]"}], ",", 
      " ", "z"}], "]"}], " ", "/.", " ", 
    RowBox[{"z", " ", "\[Rule]", " ", "\[Beta]"}]}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"dlogprdbeta", "[", 
    RowBox[{"x_", ",", " ", "\[Beta]_", ",", " ", "\[Tau]_"}], "]"}], " ", ":=",
    " ", 
   RowBox[{
    RowBox[{"D", "[", 
     RowBox[{
      RowBox[{"Log", "[", 
       RowBox[{"polytomousrasch", "[", 
        RowBox[{"x", ",", " ", "z", ",", " ", "\[Tau]"}], "]"}], "]"}], ",", 
      " ", "z"}], "]"}], " ", "/.", " ", 
    RowBox[{"z", " ", "\[Rule]", " ", "\[Beta]"}]}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "ddlogprddbeta", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"ddlogprddbeta", "[", 
    RowBox[{"0", ",", " ", "\[Beta]_", ",", " ", "\[Tau]_"}], "]"}], " ", ":=",
    " ", 
   RowBox[{
    RowBox[{"D", "[", 
     RowBox[{
      RowBox[{"Log", "[", 
       RowBox[{"polytomousrasch", "[", 
        RowBox[{"0", ",", " ", "z", ",", " ", "\[Tau]"}], "]"}], "]"}], ",", 
      " ", 
      RowBox[{"{", " ", 
       RowBox[{"z", ",", " ", "2"}], " ", "}"}]}], "]"}], " ", "/.", " ", 
    RowBox[{"z", " ", "\[Rule]", " ", "\[Beta]"}]}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"ddlogprddbeta", "[", 
    RowBox[{"x_", ",", " ", "\[Beta]_", ",", " ", "\[Tau]_"}], "]"}], " ", ":=",
    " ", 
   RowBox[{
    RowBox[{"D", "[", 
     RowBox[{
      RowBox[{"Log", "[", 
       RowBox[{"polytomousrasch", "[", 
        RowBox[{"x", ",", " ", "z", ",", " ", "\[Tau]"}], "]"}], "]"}], ",", 
      " ", 
      RowBox[{"{", " ", 
       RowBox[{"z", ",", " ", "2"}], " ", "}"}]}], "]"}], " ", "/.", " ", 
    RowBox[{"z", " ", "\[Rule]", " ", "\[Beta]"}]}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "makevararray", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"makevararray", "[", 
    RowBox[{"s_", ",", " ", "n_"}], "]"}], " ", ":=", " ", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"ToExpression", "[", 
      RowBox[{"s", " ", "<>", " ", 
       RowBox[{"ToString", "[", "i", "]"}]}], "]"}], ",", " ", 
     RowBox[{"{", " ", 
      RowBox[{"i", ",", " ", "1", ",", " ", "n"}], " ", "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"dlogprdtau", "[", 
     RowBox[{"0", ",", " ", "\[Beta]_", ",", " ", "\[Tau]_"}], "]"}], " ", ":=",
     " ", 
    RowBox[{"Module", "[", 
     RowBox[{
      RowBox[{"{", "tmp", "}"}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"tmp", " ", "=", " ", 
        RowBox[{"makevararray", "[", 
         RowBox[{"\"\<\[Tau]\>\"", ",", " ", 
          RowBox[{"Length", "[", "\[Tau]", "]"}]}], "]"}]}], ";", 
       "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"D", "[", 
         RowBox[{
          RowBox[{"Log", "[", 
           RowBox[{"polytomousrasch", "[", 
            RowBox[{"0", ",", " ", "\[Beta]", ",", " ", "tmp"}], "]"}], "]"}],
           ",", " ", 
          RowBox[{"{", " ", "tmp", " ", "}"}]}], "]"}], " ", "/.", " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{
           RowBox[{"ToExpression", "[", 
            RowBox[{
             RowBox[{"ToString", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "]"}], " ", "<>", " ", 
             "\"\< -> \>\"", " ", "<>", " ", 
             RowBox[{"ToString", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "]"}], "&"}], " ", "/@",
           " ", 
          RowBox[{"Transpose", "[", 
           RowBox[{"{", " ", 
            RowBox[{
             RowBox[{"makevararray", "[", 
              RowBox[{"\"\<\[Tau]\>\"", ",", " ", 
               RowBox[{"Length", "[", "\[Tau]", "]"}]}], "]"}], ",", " ", 
             "\[Tau]"}], " ", "}"}], "]"}]}], ")"}]}]}]}], 
     "\[IndentingNewLine]", "]"}]}], ";"}], " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"dlogprdtau", "[", 
     RowBox[{"x_", ",", " ", "\[Beta]_", ",", " ", "\[Tau]_"}], "]"}], " ", ":=",
     " ", 
    RowBox[{"Module", "[", 
     RowBox[{
      RowBox[{"{", "tmp", "}"}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"tmp", " ", "=", " ", 
        RowBox[{"makevararray", "[", 
         RowBox[{"\"\<\[Tau]\>\"", ",", " ", 
          RowBox[{"Length", "[", "\[Tau]", "]"}]}], "]"}]}], ";", 
       "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"D", "[", 
         RowBox[{
          RowBox[{"Log", "[", 
           RowBox[{"polytomousrasch", "[", 
            RowBox[{"x", ",", " ", "\[Beta]", ",", " ", "tmp"}], "]"}], "]"}],
           ",", " ", 
          RowBox[{"{", " ", "tmp", " ", "}"}]}], "]"}], " ", "/.", " ", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{
           RowBox[{"ToExpression", "[", 
            RowBox[{
             RowBox[{"ToString", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "]"}], " ", "<>", " ", 
             "\"\< -> \>\"", " ", "<>", " ", 
             RowBox[{"ToString", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "]"}], "&"}], " ", "/@",
           " ", 
          RowBox[{"Transpose", "[", 
           RowBox[{"{", " ", 
            RowBox[{
             RowBox[{"makevararray", "[", 
              RowBox[{"\"\<\[Tau]\>\"", ",", " ", 
               RowBox[{"Length", "[", "\[Tau]", "]"}]}], "]"}], ",", " ", 
             "\[Tau]"}], " ", "}"}], "]"}]}], ")"}]}]}]}], 
     "\[IndentingNewLine]", "]"}]}], ";"}], " "}]}], "Input",
 CellChangeTimes->{{3.5259871600778437`*^9, 3.5259871884606323`*^9}, {
   3.525987243278949*^9, 3.5259872435773573`*^9}, 3.525987342475374*^9, 
   3.525988904818997*^9, {3.526428040787661*^9, 3.5264281068419237`*^9}, {
   3.526428142427841*^9, 3.52642820567033*^9}, {3.526428240978441*^9, 
   3.5264282710012493`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"{", " ", 
    RowBox[{"#", ",", " ", 
     RowBox[{"{", " ", 
      RowBox[{
       RowBox[{"Log", "[", 
        RowBox[{"polytomousrasch", "[", 
         RowBox[{
          RowBox[{"#", "[", 
           RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
          RowBox[{"#", "[", 
           RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
          RowBox[{"#", "[", 
           RowBox[{"[", "3", "]"}], "]"}]}], "]"}], "]"}], ",", " ", 
       RowBox[{"dlogprdbeta", "[", 
        RowBox[{
         RowBox[{"#", "[", 
          RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
         RowBox[{"#", "[", 
          RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
         RowBox[{"#", "[", 
          RowBox[{"[", "3", "]"}], "]"}]}], "]"}], ",", " ", 
       "\[IndentingNewLine]", 
       RowBox[{"dlogprdtau", "[", 
        RowBox[{
         RowBox[{"#", "[", 
          RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
         RowBox[{"#", "[", 
          RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
         RowBox[{"#", "[", 
          RowBox[{"[", "3", "]"}], "]"}]}], "]"}]}], " ", "}"}]}], "}"}], " ",
    "&"}], " ", "/@", " ", 
  RowBox[{"Table", "[", 
   RowBox[{
    RowBox[{"{", " ", 
     RowBox[{
      RowBox[{"Random", "[", 
       RowBox[{"Integer", ",", " ", "5"}], "]"}], ",", " ", 
      RowBox[{"Random", "[", 
       RowBox[{"Real", ",", " ", "5"}], "]"}], ",", " ", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Random", "[", 
         RowBox[{"Real", ",", " ", "5"}], "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "5"}], " ", "}"}]}], "]"}]}], 
     " ", "}"}], ",", " ", 
    RowBox[{"{", " ", 
     RowBox[{"foo", ",", " ", "1", ",", " ", "10"}], " ", "}"}]}], 
   "]"}]}]], "Input",
 CellChangeTimes->{{3.5054890146140127`*^9, 3.505489111203616*^9}, {
  3.505489152470233*^9, 3.505489160385252*^9}, {3.505489233064039*^9, 
  3.505489254376178*^9}, {3.525987232058299*^9, 3.525987237342202*^9}, {
  3.5259875928242903`*^9, 3.525987595620069*^9}, {3.52642821541916*^9, 
  3.526428253326068*^9}, {3.526430575738278*^9, 3.52643057912243*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0", ",", "4.753154165320642`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9086266711727332`", ",", "4.332790218750101`", ",", 
         "0.6879947889325372`", ",", "3.5367673490532896`", ",", 
         "3.546526949872468`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "11.082656802138434`"}], ",", 
       RowBox[{"-", "4.651049866712397`"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9999846232174142`", ",", "0.9992659649810359`", ",", 
         "0.9981717963879262`", ",", "0.9344100155454664`", ",", 
         "0.7192164065618747`"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"5", ",", "3.052298188073852`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9602337356028021`", ",", "3.069160897944916`", ",", 
         "3.82198311558436`", ",", "2.2618155755503224`", ",", 
         "4.452246556063507`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "2.734600076551494`"}], ",", "2.486271203541082`", ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "0.03236585620404045`"}], ",", 
         RowBox[{"-", "0.29458176253033497`"}], ",", 
         RowBox[{"-", "0.5524133016279619`"}], ",", 
         RowBox[{"-", "0.6718306647892454`"}], ",", 
         RowBox[{"-", "0.9350803087588775`"}]}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"5", ",", "2.2785963448105786`", ",", 
       RowBox[{"{", 
        RowBox[{
        "4.679896623099664`", ",", "1.8198239853722742`", ",", 
         "2.477905959852068`", ",", "3.893574765952868`", ",", 
         "0.17402140476660113`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "2.100994228539366`"}], ",", "3.8628839492690332`", ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "0.6384237384439164`"}], ",", 
         RowBox[{"-", "0.6962647793814666`"}], ",", 
         RowBox[{"-", "0.7877772193833282`"}], ",", 
         RowBox[{"-", "0.862752709685463`"}], ",", 
         RowBox[{"-", "0.8776650280753122`"}]}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"1", ",", "2.6879600621833974`", ",", 
       RowBox[{"{", 
        RowBox[{
        "4.118110926395678`", ",", "2.6992503669837165`", ",", 
         "0.5713122110534476`", ",", "2.9373000507155584`", ",", 
         "3.2454027649149997`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "3.19623821258161`"}], ",", 
       RowBox[{"-", "1.9263345457263517`"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "0.17100046575900094`"}], ",", "0.788083732362975`", 
         ",", "0.7476272695103148`", ",", "0.4117067890066262`", ",", 
         "0.14991891648150363`"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"4", ",", "2.946096201663075`", ",", 
       RowBox[{"{", 
        RowBox[{
        "4.662685539880714`", ",", "3.604509831965457`", ",", 
         "2.5574079759824624`", ",", "4.409328852609785`", ",", 
         "1.1161585900082465`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "3.9440169001925796`"}], ",", "2.844721984104088`", ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "0.6098959346009362`"}], ",", 
         RowBox[{"-", "0.7194802816327934`"}], ",", 
         RowBox[{"-", "0.7762090095100791`"}], ",", 
         RowBox[{"-", "0.8598862437871397`"}], ",", "0.12074360758952998`"}], 
        "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"1", ",", "0.5522116438916052`", ",", 
       RowBox[{"{", 
        RowBox[{
        "1.59717424037966`", ",", "1.3401679546648695`", ",", 
         "2.294175474423886`", ",", "3.2903960683412823`", ",", 
         "2.1449276843161535`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "1.477946093029`"}], ",", "0.5040077503607647`", ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "0.6485704539387533`"}], ",", "0.12332312407934601`", 
         ",", "0.019586634778512173`", ",", "0.0014145689408915517`", ",", 
         "0.00023906467874442838`"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"4", ",", "4.06157160985429`", ",", 
       RowBox[{"{", 
        RowBox[{
        "2.6142788513242228`", ",", "1.4705720829690085`", ",", 
         "4.667021724464085`", ",", "0.16799684390142314`", ",", 
         "2.440257446557622`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "1.8117069547652063`"}], ",", 
       RowBox[{"-", "0.8093095392644366`"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "0.00010748876016823153`"}], ",", 
         RowBox[{"-", "0.000564486248725562`"}], ",", 
         RowBox[{"-", "0.006662262929948414`"}], ",", 
         RowBox[{"-", "0.0099906101022123`"}], ",", "0.8266340183798411`"}], 
        "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"1", ",", "3.782612020785611`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5489107980684076`", ",", "2.4687464769177065`", ",", 
         "1.868945235504174`", ",", "0.8453119700700524`", ",", 
         "2.303508033153408`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "7.860819606660383`"}], ",", 
       RowBox[{"-", "3.7912148027507313`"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "0.000015195507438086651`"}], ",", 
         "0.9995992429430898`", ",", "0.9981647555278607`", ",", 
         "0.9884419947940721`", ",", "0.8050236419149125`"}], "}"}]}], 
      "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"1", ",", "4.522650275254632`", ",", 
       RowBox[{"{", 
        RowBox[{
        "2.2062596956234595`", ",", "2.2408021381045953`", ",", 
         "4.746100057170946`", ",", "0.11332142264484629`", ",", 
         "1.0901011056152132`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "9.932979588263155`"}], ",", 
       RowBox[{"-", "3.9663296640969152`"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "4.788115963366397`*^-6"}], ",", "0.9999466651325283`", 
         ",", "0.9994711600562848`", ",", "0.9990908724470784`", ",", 
         "0.9678257921575993`"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"4", ",", "1.6885904942129901`", ",", 
       RowBox[{"{", 
        RowBox[{
        "3.148925816791286`", ",", "3.7731534679799767`", ",", 
         "3.795925631191327`", ",", "3.3981944258717074`", ",", 
         "1.0039981324751321`"}], "}"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "7.598042374716064`"}], ",", "3.755797069109131`", ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "0.7896194095665531`"}], ",", 
         RowBox[{"-", "0.9729354322819563`"}], ",", 
         RowBox[{"-", "0.9957329591131562`"}], ",", 
         RowBox[{"-", "0.9985042481049893`"}], ",", 
         "0.0009943197344618167`"}], "}"}]}], "}"}]}], "}"}]}], 
  "}"}]], "Output",
 CellChangeTimes->{
  3.525987207491303*^9, {3.5259872384118137`*^9, 3.52598724657666*^9}, {
   3.525987344691986*^9, 3.525987355068604*^9}, 3.525987596070009*^9, 
   3.5264276517252407`*^9, {3.526428256276692*^9, 3.526428272781323*^9}, {
   3.5264305764262257`*^9, 3.526430580364725*^9}, 3.527036189484869*^9}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["E - Step", "Subsection",
 CellChangeTimes->{{3.525095319326301*^9, 3.525095320059371*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "clampprior", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"clampprior", "[", 
    RowBox[{"c_", ",", " ", "logpriorz_"}], "]"}], " ", ":=", " ", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{"c", " ", "<", " ", "0"}], ",", " ", "logpriorz", ",", " ", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"i", " ", "\[Equal]", " ", 
          RowBox[{"c", " ", "+", " ", "1"}]}], ",", " ", 
         RowBox[{"Log", "[", "0.99999", "]"}], ",", " ", 
         RowBox[{
          RowBox[{"Log", "[", "0.00001", "]"}], " ", "-", " ", 
          RowBox[{"Log", "[", 
           RowBox[{
            RowBox[{"Length", "[", "logpriorz", "]"}], " ", "-", " ", "1"}], 
           "]"}]}]}], "]"}], ",", " ", 
       RowBox[{"{", " ", 
        RowBox[{"i", ",", " ", "1", ",", " ", 
         RowBox[{"Length", "[", "logpriorz", "]"}]}], " ", "}"}]}], "]"}]}], 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "estep", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"estep", "[", 
    RowBox[{
    "logpriorz_", ",", " ", "d_", ",", " ", "log\[Alpha]_", ",", " ", 
     "log\[Lambda]_", ",", " ", "\[Tau]_", ",", " ", "clamp_"}], "]"}], " ", ":=",
    " ", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", " ", 
      RowBox[{
       RowBox[{"logz", " ", "=", " ", 
        RowBox[{"clampprior", "[", 
         RowBox[{"clamp", ",", " ", "logpriorz"}], "]"}]}], ",", 
       "\[IndentingNewLine]", "              ", "x", ",", " ", "y", ",", 
       "\[IndentingNewLine]", "              ", "worker", ",", 
       "\[IndentingNewLine]", "              ", "rating"}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"For", "[", 
       RowBox[{
        RowBox[{"x", " ", "=", " ", "1"}], ",", " ", 
        RowBox[{"x", " ", "\[LessEqual]", " ", 
         RowBox[{"Length", "[", "d", "]"}]}], ",", " ", 
        RowBox[{"++", "x"}], ",", " ", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"worker", " ", "=", " ", 
          RowBox[{
           RowBox[{"d", "[", 
            RowBox[{"[", "x", "]"}], "]"}], "[", 
           RowBox[{"[", "1", "]"}], "]"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"rating", " ", "=", " ", 
          RowBox[{
           RowBox[{"d", "[", 
            RowBox[{"[", "x", "]"}], "]"}], "[", 
           RowBox[{"[", "2", "]"}], "]"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"For", "[", 
          RowBox[{
           RowBox[{"y", " ", "=", " ", "1"}], ",", " ", 
           RowBox[{"y", " ", "\[LessEqual]", " ", 
            RowBox[{"Length", "[", "logpriorz", "]"}]}], ",", " ", 
           RowBox[{"++", "y"}], ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"logz", "[", 
             RowBox[{"[", "y", "]"}], "]"}], " ", "+=", 
            RowBox[{"Log", "[", 
             RowBox[{"polytomousrasch", "[", 
              RowBox[{"rating", ",", 
               RowBox[{
                RowBox[{"Exp", "[", "log\[Alpha]", "]"}], " ", 
                RowBox[{"Exp", "[", 
                 RowBox[{"log\[Lambda]", "[", 
                  RowBox[{"[", "worker", "]"}], "]"}], "]"}], 
                RowBox[{"(", 
                 RowBox[{"y", " ", "-", " ", "1"}], ")"}]}], ",", " ", 
               RowBox[{
                RowBox[{"Exp", "[", "log\[Alpha]", "]"}], " ", 
                RowBox[{"Exp", "[", 
                 RowBox[{"log\[Lambda]", "[", 
                  RowBox[{"[", "worker", "]"}], "]"}], "]"}], 
                RowBox[{"\[Tau]", "[", 
                 RowBox[{"[", "worker", "]"}], "]"}]}]}], "]"}], "]"}]}]}], 
          "\[IndentingNewLine]", "]"}]}]}], "\[IndentingNewLine]", "]"}], ";",
       "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"Exp", "[", 
        RowBox[{"logz", " ", "-", " ", 
         RowBox[{"Max", "[", "logz", "]"}]}], "]"}], " ", "/", " ", 
       RowBox[{"(", 
        RowBox[{"Plus", " ", "@@", " ", 
         RowBox[{"Exp", "[", 
          RowBox[{"logz", " ", "-", " ", 
           RowBox[{"Max", "[", "logz", "]"}]}], "]"}]}], ")"}]}]}]}], 
    "\[IndentingNewLine]", "]"}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.503955461771839*^9, 3.503955547544071*^9}, {
  3.503956414315634*^9, 3.50395641749085*^9}, {3.504015123048579*^9, 
  3.504015144260337*^9}, {3.5040198586581793`*^9, 3.5040198610794373`*^9}, {
  3.504020706633234*^9, 3.504020834052479*^9}, {3.5040323138246193`*^9, 
  3.504032315116683*^9}, {3.525095358212021*^9, 3.525095394107882*^9}, {
  3.525095430271084*^9, 3.525095527225823*^9}, {3.525095825399502*^9, 
  3.525095905551168*^9}, {3.525095987054782*^9, 3.525095987476919*^9}, {
  3.52598891948461*^9, 3.5259889309018373`*^9}, {3.525988962558785*^9, 
  3.525989080996099*^9}, {3.5259891548282547`*^9, 3.5259891590757933`*^9}, {
  3.527038505467194*^9, 3.527038526780528*^9}}],

Cell[CellGroupData[{

Cell["Test Vectors for estep clamp", "Subsubsection",
 CellChangeTimes->{{3.50401932583255*^9, 3.504019328703233*^9}, {
  3.504185890254962*^9, 3.504185890709035*^9}, {3.5042036574835863`*^9, 
  3.504203657569166*^9}, {3.504916768505199*^9, 3.504916769023423*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "nworkers", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nworkers", " ", "=", " ", "4"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nlabels", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nlabels", " ", "=", " ", "5"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nratings", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nratings", " ", "=", " ", "6"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"#", "[", 
      RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
     RowBox[{"Flatten", "[", 
      RowBox[{"#", "[", 
       RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}], "&"}], " ", "/@", 
  "\[IndentingNewLine]", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{
     RowBox[{"{", " ", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"ListQ", "[", "#", "]"}], " ", "&&", " ", 
            RowBox[{"(", 
             RowBox[{
              RowBox[{"!", " ", 
               RowBox[{"ListQ", "[", 
                RowBox[{"#", "[", 
                 RowBox[{"[", "1", "]"}], "]"}], "]"}]}], " ", "||", " ", 
              RowBox[{"!", " ", 
               RowBox[{"IntegerQ", "[", 
                RowBox[{
                 RowBox[{"#", "[", 
                  RowBox[{"[", "1", "]"}], "]"}], "[", 
                 RowBox[{"[", "1", "]"}], "]"}], "]"}]}]}], ")"}]}], ",", " ", 
           RowBox[{"Flatten", "[", "#", "]"}], ",", " ", "#"}], "]"}], "&"}], 
        " ", "/@", " ", "#"}], ",", " ", "\[IndentingNewLine]", 
       RowBox[{"estep", "[", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"#", "[", 
          RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "priorz", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{"1", "+", 
              RowBox[{"#", "[", 
               RowBox[{"[", "1", "]"}], "]"}]}], ",", 
             RowBox[{"#", "[", 
              RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "&"}], " ", "/@", " ", 
          
          RowBox[{"#", "[", 
           RowBox[{"[", "2", "]"}], "]"}]}], ",", " ", 
         RowBox[{"(*", " ", "d", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "3", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "4", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], 
         "\[IndentingNewLine]", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"Table", "[", 
            RowBox[{
             RowBox[{"j", "  ", "-", " ", "0.5", " ", "+", " ", 
              RowBox[{
               RowBox[{
                RowBox[{"#", "[", 
                 RowBox[{"[", "5", "]"}], "]"}], "[", 
                RowBox[{"[", "k", "]"}], "]"}], "[", 
               RowBox[{"[", "j", "]"}], "]"}]}], ",", 
             RowBox[{"{", " ", 
              RowBox[{"j", ",", " ", "1", ",", " ", 
               RowBox[{"Length", "[", 
                RowBox[{
                 RowBox[{"#", "[", 
                  RowBox[{"[", "5", "]"}], "]"}], "[", 
                 RowBox[{"[", "k", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",",
            " ", 
           RowBox[{"{", " ", 
            RowBox[{"k", ",", " ", "1", ",", " ", 
             RowBox[{"Length", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "5", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", 
         RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "6", "]"}], "]"}]}], " ", 
        RowBox[{"(*", " ", "clamp", " ", "*)"}], "\[IndentingNewLine]", 
        "]"}]}], " ", "}"}], "&"}], " ", "/@", " ", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{"{", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Random", "[", "]"}], ",", " ", 
          RowBox[{"{", 
           RowBox[{"i", ",", " ", "1", ",", " ", "nlabels"}], "}"}]}], "]"}], 
        ",", " ", 
        RowBox[{"(*", " ", "priorz", " ", "*)"}], "\[IndentingNewLine]", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{
            RowBox[{"Random", "[", 
             RowBox[{"Integer", ",", " ", 
              RowBox[{"nworkers", " ", "-", " ", "1"}]}], "]"}], ",", 
            RowBox[{"Random", "[", 
             RowBox[{"Integer", ",", " ", 
              RowBox[{"nlabels", " ", "-", " ", "1"}]}], "]"}]}], "}"}], ",", 
          " ", 
          RowBox[{"{", " ", 
           RowBox[{"i", ",", " ", "1", ",", " ", "nratings"}], " ", "}"}]}], 
         "]"}], ",", 
        RowBox[{"(*", " ", "d", " ", "*)"}], "\[IndentingNewLine]", 
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
        
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Random", "[", "]"}], ",", " ", 
          RowBox[{"{", " ", 
           RowBox[{"i", ",", " ", "1", ",", " ", "nworkers"}], " ", "}"}]}], 
         "]"}], ",", " ", 
        RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], " ", 
        "\[IndentingNewLine]", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Table", "[", 
           RowBox[{
            RowBox[{"0.2", " ", 
             RowBox[{"Random", "[", "]"}]}], ",", 
            RowBox[{"{", " ", 
             RowBox[{"j", ",", " ", "1", ",", " ", 
              RowBox[{"nlabels", " ", "-", " ", "1"}]}], "}"}]}], "]"}], ",", 
          " ", 
          RowBox[{"{", " ", 
           RowBox[{"k", ",", " ", "1", ",", " ", "nworkers"}], "}"}]}], "]"}],
         ",", " ", 
        RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"Random", "[", "]"}], " ", "<", " ", "0.5"}], ",", " ", 
          RowBox[{"-", "1"}], ",", " ", 
          RowBox[{"Random", "[", 
           RowBox[{"Integer", ",", " ", 
            RowBox[{"nlabels", " ", "-", " ", "1"}]}], "]"}]}], "]"}]}], " ", 
       
       RowBox[{"(*", " ", "clamp", " ", "*)"}], "\[IndentingNewLine]", "}"}], 
      ",", " ", 
      RowBox[{"{", " ", 
       RowBox[{"foo", ",", " ", "1", ",", " ", "10"}], " ", "}"}]}], "]"}]}], 
   ")"}]}]}], "Input",
 CellChangeTimes->{{3.504016424813343*^9, 3.504016580297758*^9}, {
   3.504018269599441*^9, 3.504018279219314*^9}, {3.504018359153508*^9, 
   3.504018387475568*^9}, {3.5040184327040863`*^9, 3.504018509500141*^9}, {
   3.504018861653284*^9, 3.504018920277594*^9}, {3.504019049785894*^9, 
   3.504019065803638*^9}, 3.504019184180941*^9, {3.504059801963703*^9, 
   3.504059813764331*^9}, 3.5040599982883453`*^9, {3.504060100407703*^9, 
   3.504060104803857*^9}, 3.504060440796597*^9, {3.504060503267675*^9, 
   3.504060525182757*^9}, {3.50418590618461*^9, 3.504185912579707*^9}, {
   3.504186397115213*^9, 3.5041864627493553`*^9}, {3.504187243434793*^9, 
   3.504187335384948*^9}, {3.5041877893781147`*^9, 3.504187789468603*^9}, {
   3.5042036666855288`*^9, 3.504203720287292*^9}, {3.504203761143361*^9, 
   3.5042038785987473`*^9}, 3.504204172101022*^9, {3.504204669966267*^9, 
   3.504204721532045*^9}, {3.504205201368525*^9, 3.50420520145702*^9}, {
   3.505589135463067*^9, 3.505589138197913*^9}, {3.505589410144479*^9, 
   3.505589470226988*^9}, {3.50558950031635*^9, 3.5055895318620234`*^9}, {
   3.505593036660348*^9, 3.5055930431613007`*^9}, 3.505593571277896*^9, {
   3.5055946005056257`*^9, 3.505594637819249*^9}, {3.505594708646364*^9, 
   3.5055947672213717`*^9}, 3.505594822362433*^9, 3.505694904993847*^9, 
   3.50569495400416*^9, {3.5057484466063337`*^9, 3.505748464550887*^9}, 
   3.505759963261848*^9, {3.50594173038643*^9, 3.505941756411881*^9}, 
   3.5059418679837847`*^9, {3.525989118603919*^9, 3.525989133588447*^9}, {
   3.525989176585618*^9, 3.525989329780985*^9}, {3.5259894579149*^9, 
   3.525989471950355*^9}, {3.525989581415557*^9, 3.525989585593624*^9}, {
   3.525992245973118*^9, 3.52599228203554*^9}, 3.5259939716950493`*^9, {
   3.527036152680112*^9, 3.5270361807314568`*^9}, {3.527036265698546*^9, 
   3.527036266168323*^9}, 3.527036368077401*^9, {3.5270365457436237`*^9, 
   3.527036593361165*^9}, 3.5270366239028397`*^9, {3.527036753682835*^9, 
   3.5270367542957773`*^9}, {3.527036835740769*^9, 3.527036841375969*^9}, {
   3.527037955967847*^9, 3.527037979360462*^9}, {3.527038099170415*^9, 
   3.5270380994422493`*^9}, 3.527038608909306*^9, 3.5270386414534082`*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.8149491687771858`", ",", "0.141617127630331`", ",", 
         "0.7658009324407958`", ",", "0.9810220069733527`", ",", 
         "0.1034455297791702`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}]}], "}"}], ",", 
       "0.10663558977382692`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.3094775923305763`", ",", "0.5752983953551049`", ",", 
         "0.6434351608959428`", ",", "0.42637041111776625`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.16695748384779557`", ",", "0.15191801631992533`", ",", 
         "0.11992700548930613`", ",", "0.10764190463251772`", ",", 
         "0.10373492363062382`", ",", "0.15773718791922178`", ",", 
         "0.043557865065165145`", ",", "0.049698470435329524`", ",", 
         "0.09441924544329272`", ",", "0.07913996801892484`", ",", 
         "0.058838860614192905`", ",", "0.026566648101030634`", ",", 
         "0.05021735030419394`", ",", "0.06662609678204284`", ",", 
         "0.09584902685875574`", ",", "0.19824322257496443`"}], "}"}], ",", 
       RowBox[{"-", "1"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "7.1900267228836454`*^-12", ",", "0.00015412974786040512`", ",", 
       "0.9383268979676492`", ",", "0.06151891090862784`", ",", 
       "6.13686724974743`*^-8"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.3521084769368614`", ",", "0.3757996045146085`", ",", 
         "0.8845805231009952`", ",", "0.1758082267495975`", ",", 
         "0.7768100815817565`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", "0.7323644436186657`",
        ",", 
       RowBox[{"{", 
        RowBox[{
        "0.458210111983229`", ",", "0.3410208075106197`", ",", 
         "0.01721999998212995`", ",", "0.13272941617213507`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.1840001177641281`", ",", "0.16446923787150014`", ",", 
         "0.045706812077204215`", ",", "0.18298801816926188`", ",", 
         "0.13430164732879857`", ",", "0.0700499924282074`", ",", 
         "0.16656684405827937`", ",", "0.12414915755506897`", ",", 
         "0.10773499922776796`", ",", "0.019832642124013464`", ",", 
         "0.09994074727623654`", ",", "0.028300130696313232`", ",", 
         "0.10949177665280352`", ",", "0.1227754783079787`", ",", 
         "0.029519051888864258`", ",", "0.15314020979339155`"}], "}"}], ",", 
       "3"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "2.46502251845536`*^-38", ",", "1.2067508514957717`*^-21", ",", 
       "9.99667190569615`*^-11", ",", "0.9999998890839324`", ",", 
       "1.1081610077531447`*^-7"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.43806916479029595`", ",", "0.37078517786256476`", ",", 
         "0.03333660534829197`", ",", "0.20466824817979334`", ",", 
         "0.0970483572796763`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}]}], "}"}], ",", 
       "0.35356517788043484`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9006071891761569`", ",", "0.2846676593591529`", ",", 
         "0.2747021679221757`", ",", "0.12503111749441378`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.19713341966596953`", ",", "0.122631884543032`", ",", 
         "0.18489044115622777`", ",", "0.05843937944060338`", ",", 
         "0.07298426211090055`", ",", "0.014896885315264063`", ",", 
         "0.1650577990322143`", ",", "0.15849863216436685`", ",", 
         "0.04468413141458732`", ",", "0.10540510866246056`", ",", 
         "0.042282320724235586`", ",", "0.12897958027550258`", ",", 
         "0.09154392162119579`", ",", "0.1728294366298561`", ",", 
         "0.1546684877661764`", ",", "0.05482254470298963`"}], "}"}], ",", 
       RowBox[{"-", "1"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "3.424893134097151`*^-9", ",", "0.004918832430445385`", ",", 
       "0.9829135028348275`", ",", "0.012167651760589438`", ",", 
       "9.549244484033328`*^-9"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.6594789349694871`", ",", "0.6762940815512056`", ",", 
         "0.9205475456345132`", ",", "0.52377581358153`", ",", 
         "0.37481127561033417`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.40159191362902996`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7955164281400995`", ",", "0.5381087152516825`", ",", 
         "0.7616518528951741`", ",", "0.4771397078478912`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.10066390618741652`", ",", "0.03463748093943595`", ",", 
         "0.13743348526377078`", ",", "0.13037014253736398`", ",", 
         "0.14216527402304968`", ",", "0.18995334952484866`", ",", 
         "0.032028376601310214`", ",", "0.0880878218131284`", ",", 
         "0.01318569374754711`", ",", "0.09840942790365287`", ",", 
         "0.05919893997145414`", ",", "0.13341933404695203`", ",", 
         "0.1583631490445575`", ",", "0.013532827352115476`", ",", 
         "0.12730315297755673`", ",", "0.19816051773671087`"}], "}"}], ",", 
       "2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "2.5953211601172505`*^-32", ",", "5.040240922700237`*^-16", ",", 
       "0.99851155393226`", ",", "0.0014881596003619682`", ",", 
       "2.864673775502187`*^-7"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.5438883231790473`", ",", "0.26170448927744944`", ",", 
         "0.5892106750545244`", ",", "0.07575177144817462`", ",", 
         "0.005779607927364908`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", "0.5000526363822753`",
        ",", 
       RowBox[{"{", 
        RowBox[{
        "0.11207096720663316`", ",", "0.572432240511092`", ",", 
         "0.8325922032301851`", ",", "0.8128852100634214`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.09204405090396267`", ",", "0.17232117407916872`", ",", 
         "0.1765650911211884`", ",", "0.13054866541137408`", ",", 
         "0.003956229090834278`", ",", "0.15913548033162161`", ",", 
         "0.07815566321753553`", ",", "0.07134972543991994`", ",", 
         "0.07053689504388228`", ",", "0.0007723312870641131`", ",", 
         "0.06462283586542006`", ",", "0.14404657246236321`", ",", 
         "0.07237637730717142`", ",", "0.02651869136940929`", ",", 
         "0.1558451712296106`", ",", "0.09170567460687334`"}], "}"}], ",", 
       "4"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "1.715877384319907`*^-34", ",", "6.94317259056752`*^-16", ",", 
       "0.00004892700803296674`", ",", "0.07801816138610149`", ",", 
       "0.921932911605865`"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.056841685398871813`", ",", "0.773446248220688`", ",", 
         "0.9584757366520914`", ",", "0.6606002442746994`", ",", 
         "0.4844094448877798`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}]}], "}"}], ",", "0.9408540449905028`",
        ",", 
       RowBox[{"{", 
        RowBox[{
        "0.14559052658867`", ",", "0.20037998975488616`", ",", 
         "0.6228035744919364`", ",", "0.05802858938456088`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.09856943990635994`", ",", "0.03611976886014295`", ",", 
         "0.16542523456676567`", ",", "0.13345005465937665`", ",", 
         "0.02721971446644`", ",", "0.1655828738162607`", ",", 
         "0.16465290327970156`", ",", "0.06882721879395658`", ",", 
         "0.08317314200407679`", ",", "0.09320649650908927`", ",", 
         "0.13813421191029226`", ",", "0.112982047564346`", ",", 
         "0.19146746739720344`", ",", "0.13867225421282275`", ",", 
         "0.1267658748305179`", ",", "0.1582927979202084`"}], "}"}], ",", 
       "3"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "0.0007186311345318554`", ",", "0.9992808937973874`", ",", 
       "4.7506808065559895`*^-7", ",", "1.7389691633785238`*^-17", ",", 
       "4.019104414612246`*^-49"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.03276102678941421`", ",", "0.14941992926480965`", ",", 
         "0.8506099446105391`", ",", "0.8532710737452558`", ",", 
         "0.832381037034528`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}]}], "}"}], ",", "0.5266163547728734`",
        ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7925813552259782`", ",", "0.3604238742134562`", ",", 
         "0.6517821927338133`", ",", "0.6994901819390451`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.025066216385819004`", ",", "0.04486506037625124`", ",", 
         "0.16477356473050198`", ",", "0.17524513310810746`", ",", 
         "0.15623899759186244`", ",", "0.16169191837217445`", ",", 
         "0.07156706822141272`", ",", "0.0371109211978152`", ",", 
         "0.04325695002751642`", ",", "0.17022445097497102`", ",", 
         "0.13289481400859`", ",", "0.1103450463672973`", ",", 
         "0.08496415210730804`", ",", "0.17045213090818587`", ",", 
         "0.12634260865070715`", ",", "0.08046106051433538`"}], "}"}], ",", 
       "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "2.643435389691721`*^-13", ",", "0.9999994190640258`", ",", 
       "5.809357096457395`*^-7", ",", "4.10123668389991`*^-16", ",", 
       "9.927621962175151`*^-34"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.9989895807956733`", ",", "0.7993320062190076`", ",", 
         "0.8756889477988035`", ",", "0.7816294607000228`", ",", 
         "0.6385657065822172`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}]}], "}"}], ",", 
       "0.14754981348519433`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.17619876585975844`", ",", "0.6562983787709278`", ",", 
         "0.414240404700961`", ",", "0.3236819898326844`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.059994620063844234`", ",", "0.17502067816232314`", ",", 
         "0.12115616256801776`", ",", "0.19316932974512419`", ",", 
         "0.022883698866029024`", ",", "0.13176372813480672`", ",", 
         "0.15093171159304675`", ",", "0.06027451573653419`", ",", 
         "0.11253865249873173`", ",", "0.04679957602749869`", ",", 
         "0.18047958068486092`", ",", "0.13393190708582706`", ",", 
         "0.03207759198439635`", ",", "0.13195741284229848`", ",", 
         "0.18068166452572623`", ",", "0.17406550584202554`"}], "}"}], ",", 
       RowBox[{"-", "1"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "1.3447576885187107`*^-7", ",", "0.01885066530714215`", ",", 
       "0.9781023558862245`", ",", "0.003046843234013778`", ",", 
       "1.0968507307019464`*^-9"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.8781576035114695`", ",", "0.26484261604641396`", ",", 
         "0.7227777157249333`", ",", "0.10850024626341982`", ",", 
         "0.22185922474054173`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}]}], "}"}], ",", "0.8506022113454529`",
        ",", 
       RowBox[{"{", 
        RowBox[{
        "0.3990957258922489`", ",", "0.8085271459441987`", ",", 
         "0.346755833928926`", ",", "0.24482139850536414`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.08664981543332562`", ",", "0.13882173032281073`", ",", 
         "0.1375874386509785`", ",", "0.09803256810802607`", ",", 
         "0.026375299696791418`", ",", "0.026283077824078994`", ",", 
         "0.09078786262347979`", ",", "0.11755298742316517`", ",", 
         "0.09244339261096438`", ",", "0.19420548583968267`", ",", 
         "0.15883044978118133`", ",", "0.13687132289743895`", ",", 
         "0.11837788676893884`", ",", "0.137265683415047`", ",", 
         "0.1831989290788874`", ",", "0.08390279968815613`"}], "}"}], ",", 
       "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "5.939662644471675`*^-27", ",", "0.0004290913403548111`", ",", 
       "0.6584142989952687`", ",", "0.34115660955809396`", ",", 
       "1.0628250925247426`*^-10"}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0.5778281708118151`", ",", "0.6941354206538952`", ",", 
         "0.5689117870953277`", ",", "0.470015992227512`", ",", 
         "0.7693010248676164`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}]}], "}"}], ",", "0.3473795867249692`",
        ",", 
       RowBox[{"{", 
        RowBox[{
        "0.3240903885899636`", ",", "0.036766915060883996`", ",", 
         "0.07519237325356286`", ",", "0.6594423934700768`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.16678550960996663`", ",", "0.1809780833153854`", ",", 
         "0.1887553968266336`", ",", "0.04110061607053558`", ",", 
         "0.04923252218680148`", ",", "0.08853469070442102`", ",", 
         "0.19454991098695096`", ",", "0.08227016628935427`", ",", 
         "0.11236119928936256`", ",", "0.1701568039354822`", ",", 
         "0.05728422757190395`", ",", "0.09907123721046687`", ",", 
         "0.02845839960120642`", ",", "0.19633446031153`", ",", 
         "0.14171859340954093`", ",", "0.16024415307968784`"}], "}"}], ",", 
       "1"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "6.81143013179566`*^-15", ",", "0.9937931045800555`", ",", 
       "0.006197821253937528`", ",", "9.07416598606157`*^-6", ",", 
       "1.4041509683667297`*^-14"}], "}"}]}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{{3.5259893340334177`*^9, 3.525989337502638*^9}, {
   3.525989472752367*^9, 3.5259894937597933`*^9}, {3.525989581925304*^9, 
   3.525989628149845*^9}, {3.525989666130809*^9, 3.525989681715674*^9}, {
   3.525992246364429*^9, 3.5259922825877943`*^9}, 3.525993972290413*^9, {
   3.5270361825800858`*^9, 3.527036196532954*^9}, 3.527036267904974*^9, 
   3.527036368425497*^9, {3.5270365945244102`*^9, 3.527036624415978*^9}, 
   3.527036756052731*^9, {3.527036836565331*^9, 3.527036852886896*^9}, {
   3.5270379594924088`*^9, 3.527037979602713*^9}, {3.527038022418974*^9, 
   3.527038026823287*^9}, 3.527038100166356*^9, 3.527038530506792*^9, 
   3.527038609261449*^9, 3.5270386420612087`*^9}]
}, Open  ]]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell["Qfunc", "Subsection",
 CellChangeTimes->{{3.525095319326301*^9, 3.525095320059371*^9}, {
   3.526411808061521*^9, 3.526411811200098*^9}, 3.526492345471158*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "qfunc", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"qfunc", "[", 
    RowBox[{
    "\[Kappa]_", ",", " ", "log\[Alpha]_", ",", " ", "\[Tau]_", ",", " ", 
     "log\[Lambda]_", ",", " ", "pz_", ",", "d_", ",", " ", "plog\[Alpha]_"}],
     "]"}], " ", ":=", " ", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"q", " ", "=", " ", "0"}], ",", " ", "x", ",", " ", "y", ",", 
       " ", "z", ",", " ", "worker", ",", " ", "rating"}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"For", "[", 
       RowBox[{
        RowBox[{"x", " ", "=", " ", "1"}], ",", " ", 
        RowBox[{"x", " ", "\[LessEqual]", " ", 
         RowBox[{"Length", "[", "pz", "]"}]}], ",", " ", 
        RowBox[{"++", "x"}], ",", "\[IndentingNewLine]", 
        RowBox[{"q", " ", "-=", " ", 
         RowBox[{
          RowBox[{"pz", "[", 
           RowBox[{"[", "x", "]"}], "]"}], " ", 
          RowBox[{"Log", "[", 
           RowBox[{"pz", "[", 
            RowBox[{"[", "x", "]"}], "]"}], "]"}]}]}]}], 
       "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", 
      RowBox[{"For", "[", 
       RowBox[{
        RowBox[{"x", " ", "=", " ", "1"}], ",", " ", 
        RowBox[{"x", " ", "\[LessEqual]", " ", 
         RowBox[{"Length", "[", "d", "]"}]}], ",", " ", 
        RowBox[{"++", "x"}], ",", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"worker", " ", "=", " ", 
          RowBox[{
           RowBox[{"d", "[", 
            RowBox[{"[", "x", "]"}], "]"}], "[", 
           RowBox[{"[", "1", "]"}], "]"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"rating", " ", "=", " ", 
          RowBox[{
           RowBox[{"d", "[", 
            RowBox[{"[", "x", "]"}], "]"}], "[", 
           RowBox[{"[", "2", "]"}], "]"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"For", "[", 
          RowBox[{
           RowBox[{"y", " ", "=", " ", "1"}], ",", " ", 
           RowBox[{"y", " ", "\[LessEqual]", " ", 
            RowBox[{"Length", "[", "pz", "]"}]}], ",", " ", 
           RowBox[{"++", "y"}], ",", "\[IndentingNewLine]", 
           RowBox[{"q", " ", "+=", " ", 
            RowBox[{
             RowBox[{"pz", "[", 
              RowBox[{"[", "y", "]"}], "]"}], 
             RowBox[{"Log", "[", 
              RowBox[{"polytomousrasch", "[", 
               RowBox[{"rating", ",", " ", 
                RowBox[{
                 RowBox[{"Exp", "[", "log\[Alpha]", "]"}], " ", 
                 RowBox[{"Exp", "[", 
                  RowBox[{"log\[Lambda]", "[", 
                   RowBox[{"[", "worker", "]"}], "]"}], "]"}], " ", 
                 RowBox[{"(", 
                  RowBox[{"y", " ", "-", " ", "1"}], ")"}]}], ",", " ", 
                RowBox[{
                 RowBox[{"Exp", "[", "log\[Alpha]", "]"}], " ", 
                 RowBox[{"Exp", "[", 
                  RowBox[{"log\[Lambda]", "[", 
                   RowBox[{"[", "worker", "]"}], "]"}], "]"}], 
                 RowBox[{"\[Tau]", "[", 
                  RowBox[{"[", "worker", "]"}], "]"}]}]}], "]"}], "]"}]}]}]}],
           "\[IndentingNewLine]", "]"}]}]}], "\[IndentingNewLine]", "]"}], 
      ";", "\[IndentingNewLine]", "\[IndentingNewLine]", 
      RowBox[{"q", " ", "+=", " ", 
       RowBox[{"Log", "[", 
        RowBox[{"PDF", "[", 
         RowBox[{
          RowBox[{"plog\[Alpha]", "[", "\[Kappa]", "]"}], ",", " ", 
          "log\[Alpha]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", 
      "q"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.505595455899826*^9, 3.5055954815028133`*^9}, {
   3.505595591072061*^9, 3.505595746588525*^9}, {3.505595921361999*^9, 
   3.505595921696361*^9}, {3.505673645537788*^9, 3.505673719447109*^9}, {
   3.505673756166316*^9, 3.505673756674253*^9}, {3.505694245510009*^9, 
   3.505694268051146*^9}, {3.505760009986413*^9, 3.5057600165699587`*^9}, {
   3.50576005721931*^9, 3.505760078610647*^9}, {3.5057625246204443`*^9, 
   3.505762552682109*^9}, {3.5057627938738422`*^9, 3.505762797951902*^9}, {
   3.505765158450721*^9, 3.505765213777804*^9}, {3.5059421283530493`*^9, 
   3.505942210664938*^9}, {3.506003737712338*^9, 3.5060037700735073`*^9}, {
   3.522541916078946*^9, 3.522541921920133*^9}, {3.526411842479517*^9, 
   3.526412026433256*^9}, 3.526412647091461*^9, {3.526413173677617*^9, 
   3.526413177796151*^9}, {3.526413211815695*^9, 3.5264132663530617`*^9}}],

Cell[CellGroupData[{

Cell["Test Vectors for Q func", "Subsubsection",
 CellChangeTimes->{{3.50401932583255*^9, 3.504019328703233*^9}, {
  3.504185890254962*^9, 3.504185890709035*^9}, {3.5042036574835863`*^9, 
  3.504203657569166*^9}, {3.504916768505199*^9, 3.504916769023423*^9}, {
  3.5264122361917953`*^9, 3.526412241984367*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "nworkers", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nworkers", " ", "=", " ", "4"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nlabels", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nlabels", " ", "=", " ", "5"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nratings", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nratings", " ", "=", " ", "8"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", " ", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
          RowBox[{"ListQ", "[", "#", "]"}], " ", "&&", " ", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"!", " ", 
             RowBox[{"ListQ", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "]"}]}], " ", "||", " ", 
            RowBox[{"!", " ", 
             RowBox[{"IntegerQ", "[", 
              RowBox[{
               RowBox[{"#", "[", 
                RowBox[{"[", "1", "]"}], "]"}], "[", 
               RowBox[{"[", "1", "]"}], "]"}], "]"}]}]}], ")"}]}], ",", " ", 
         RowBox[{"Flatten", "[", "#", "]"}], ",", " ", "#"}], "]"}], "&"}], 
      " ", "/@", " ", "#"}], ",", " ", "\[IndentingNewLine]", 
     RowBox[{"{", " ", 
      RowBox[{
       RowBox[{"qfunc", "[", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"#", "[", 
          RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"Table", "[", 
            RowBox[{
             RowBox[{"j", "  ", "-", " ", "0.5", " ", "+", " ", 
              RowBox[{
               RowBox[{
                RowBox[{"#", "[", 
                 RowBox[{"[", "3", "]"}], "]"}], "[", 
                RowBox[{"[", "k", "]"}], "]"}], "[", 
               RowBox[{"[", "j", "]"}], "]"}]}], ",", 
             RowBox[{"{", " ", 
              RowBox[{"j", ",", " ", "1", ",", " ", 
               RowBox[{"Length", "[", 
                RowBox[{
                 RowBox[{"#", "[", 
                  RowBox[{"[", "3", "]"}], "]"}], "[", 
                 RowBox[{"[", "k", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",",
            " ", 
           RowBox[{"{", " ", 
            RowBox[{"k", ",", " ", "1", ",", " ", 
             RowBox[{"Length", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "3", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", 
         RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "4", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], 
         "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "5", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "pz", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{
            RowBox[{"{", 
             RowBox[{
              RowBox[{"1", "+", 
               RowBox[{"#", "[", 
                RowBox[{"[", "1", "]"}], "]"}]}], ",", 
              RowBox[{"#", "[", 
               RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "&"}], " ", "/@", " ", 
           RowBox[{"#", "[", 
            RowBox[{"[", "6", "]"}], "]"}]}], ")"}], ",", " ", 
         RowBox[{"(*", " ", "d", " ", "*)"}], 
         RowBox[{"Function", "[", 
          RowBox[{"x", ",", " ", 
           RowBox[{"NormalDistribution", "[", 
            RowBox[{"x", ",", " ", 
             RowBox[{"#", "[", 
              RowBox[{"[", "7", "]"}], "]"}]}], "]"}]}], "]"}]}], " ", 
        RowBox[{"(*", " ", "plog\[Alpha]", " ", "*)"}], "\[IndentingNewLine]",
         "]"}], ",", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"D", "[", 
         RowBox[{
          RowBox[{"qfunc", "[", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"#", "[", 
             RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
            RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]",
             "z", ",", " ", 
            RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], 
            "\[IndentingNewLine]", 
            RowBox[{"Table", "[", 
             RowBox[{
              RowBox[{"Table", "[", 
               RowBox[{
                RowBox[{"j", "  ", "-", " ", "0.5", " ", "+", " ", 
                 RowBox[{
                  RowBox[{
                   RowBox[{"#", "[", 
                    RowBox[{"[", "3", "]"}], "]"}], "[", 
                   RowBox[{"[", "k", "]"}], "]"}], "[", 
                  RowBox[{"[", "j", "]"}], "]"}]}], ",", 
                RowBox[{"{", " ", 
                 RowBox[{"j", ",", " ", "1", ",", " ", 
                  RowBox[{"Length", "[", 
                   RowBox[{
                    RowBox[{"#", "[", 
                    RowBox[{"[", "3", "]"}], "]"}], "[", 
                    RowBox[{"[", "k", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], 
              ",", " ", 
              RowBox[{"{", " ", 
               RowBox[{"k", ",", " ", "1", ",", " ", 
                RowBox[{"Length", "[", 
                 RowBox[{"#", "[", 
                  RowBox[{"[", "3", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], 
            ",", 
            RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
            RowBox[{"#", "[", 
             RowBox[{"[", "4", "]"}], "]"}], ",", " ", 
            RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], 
            "\[IndentingNewLine]", 
            RowBox[{"#", "[", 
             RowBox[{"[", "5", "]"}], "]"}], ",", " ", 
            RowBox[{"(*", " ", "pz", " ", "*)"}], "\[IndentingNewLine]", 
            RowBox[{"(", 
             RowBox[{
              RowBox[{
               RowBox[{"{", 
                RowBox[{
                 RowBox[{"1", "+", 
                  RowBox[{"#", "[", 
                   RowBox[{"[", "1", "]"}], "]"}]}], ",", 
                 RowBox[{"#", "[", 
                  RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "&"}], " ", "/@", 
              " ", 
              RowBox[{"#", "[", 
               RowBox[{"[", "6", "]"}], "]"}]}], ")"}], ",", " ", 
            RowBox[{"(*", " ", "d", " ", "*)"}], 
            RowBox[{"Function", "[", 
             RowBox[{"x", ",", " ", 
              RowBox[{"NormalDistribution", "[", 
               RowBox[{"x", ",", " ", 
                RowBox[{"#", "[", 
                 RowBox[{"[", "7", "]"}], "]"}]}], "]"}]}], "]"}]}], " ", 
           RowBox[{"(*", " ", "plog\[Alpha]", " ", "*)"}], 
           "\[IndentingNewLine]", "]"}], ",", " ", "z"}], "]"}], " ", "/.", 
        " ", 
        RowBox[{"z", " ", "\[Rule]", " ", 
         RowBox[{"#", "[", 
          RowBox[{"[", "2", "]"}], "]"}]}]}]}], "\[IndentingNewLine]", 
      "}"}]}], "\[IndentingNewLine]", "}"}], "&"}], "/@", 
  "\[IndentingNewLine]", 
  RowBox[{"Table", "[", 
   RowBox[{
    RowBox[{"{", " ", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Random", "[", "]"}], ",", " ", 
      RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Random", "[", "]"}], ",", " ", 
      RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Random", "[", "]"}], ",", " ", 
          RowBox[{"{", " ", 
           RowBox[{"i", ",", " ", "1", ",", " ", 
            RowBox[{"nlabels", " ", "-", " ", "1"}]}], "}"}]}], "]"}], ",", 
        " ", 
        RowBox[{"{", " ", 
         RowBox[{"k", ",", " ", "1", ",", " ", "nworkers"}], "}"}]}], "]"}], 
      ",", " ", 
      RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nworkers"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nlabels"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "pz", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"{", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{"Random", "[", 
           RowBox[{"Integer", ",", " ", 
            RowBox[{"nworkers", " ", "-", " ", "1"}]}], "]"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"Random", "[", 
           RowBox[{"Integer", ",", " ", 
            RowBox[{"nlabels", " ", "-", " ", "1"}]}], "]"}]}], 
         "\[IndentingNewLine]", "}"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nratings"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "d", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Random", "[", "]"}]}], " ", 
     RowBox[{"(*", " ", 
      RowBox[{"plog\[Alpha]", " ", "stddev"}], " ", "*)"}], 
     "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{"{", " ", 
     RowBox[{"foo", ",", " ", "1", ",", " ", "10"}], " ", "}"}]}], 
   "]"}]}]}], "Input",
 CellChangeTimes->{{3.504016424813343*^9, 3.504016580297758*^9}, {
   3.504018269599441*^9, 3.504018279219314*^9}, {3.504018359153508*^9, 
   3.504018387475568*^9}, {3.5040184327040863`*^9, 3.504018509500141*^9}, {
   3.504018861653284*^9, 3.504018920277594*^9}, {3.504019049785894*^9, 
   3.504019065803638*^9}, 3.504019184180941*^9, {3.504059801963703*^9, 
   3.504059813764331*^9}, 3.5040599982883453`*^9, {3.504060100407703*^9, 
   3.504060104803857*^9}, 3.504060440796597*^9, {3.504060503267675*^9, 
   3.504060525182757*^9}, {3.50456047953319*^9, 3.504560681387557*^9}, {
   3.504577463729417*^9, 3.504577464011519*^9}, {3.504577589051256*^9, 
   3.504577590132493*^9}, {3.504577632742776*^9, 3.5045776330605373`*^9}, {
   3.504740502012248*^9, 3.504740503922497*^9}, {3.504740727150861*^9, 
   3.504740736352736*^9}, 3.504876469621917*^9, {3.5055962008030443`*^9, 
   3.505596275077857*^9}, {3.505596319880871*^9, 3.505596373226162*^9}, {
   3.505596415459552*^9, 3.505596505766666*^9}, {3.50559654044011*^9, 
   3.505596540734797*^9}, 3.505672802683957*^9, 3.5056942774993753`*^9, {
   3.505694366620678*^9, 3.505694366726482*^9}, {3.5057600362594757`*^9, 
   3.5057600462592773`*^9}, 3.505760218072028*^9, {3.5057618784831467`*^9, 
   3.5057618855096197`*^9}, {3.505765314690784*^9, 3.505765460997046*^9}, {
   3.505765519815023*^9, 3.505765560295491*^9}, 3.505765708877458*^9, {
   3.5059422297177*^9, 3.50594224933794*^9}, {3.5059422915411587`*^9, 
   3.5059423868650618`*^9}, {3.505942419849204*^9, 3.505942458271961*^9}, 
   3.506003797955632*^9, 3.522544655482306*^9, 3.522544695510792*^9, {
   3.526412258232821*^9, 3.5264124297647047`*^9}, {3.526412534152213*^9, 
   3.526412549418888*^9}, {3.526412580963234*^9, 3.526412612442492*^9}, {
   3.52641284537436*^9, 3.526412862526091*^9}, {3.526412977275703*^9, 
   3.526412977409284*^9}, {3.5264130300128517`*^9, 3.526413071567891*^9}, {
   3.5264131895823917`*^9, 3.5264131965298567`*^9}, {3.5264133128542147`*^9, 
   3.526413315530311*^9}, {3.526413392188962*^9, 3.5264134345921392`*^9}, {
   3.526413727365831*^9, 3.526413730697576*^9}, {3.52641407631104*^9, 
   3.526414085568967*^9}, 3.526430667444561*^9, 3.52643074409554*^9, {
   3.5270387488016453`*^9, 3.527038761768602*^9}, 3.527038800037517*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.511656309330138`", ",", "0.9392919421800882`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.45384117867346996`", ",", "0.24928982232074076`", ",", 
         "0.474889394269254`", ",", "0.8640995689265253`", ",", 
         "0.7943987852033931`", ",", "0.41536227427090755`", ",", 
         "0.5699989776923271`", ",", "0.9203225847933574`", ",", 
         "0.5888957048507153`", ",", "0.16919966333690017`", ",", 
         "0.12732552417022197`", ",", "0.9475730298586028`", ",", 
         "0.17754487340394395`", ",", "0.6073936668900874`", ",", 
         "0.2765415044928111`", ",", "0.6611518919990831`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6821886873516096`", ",", "0.46510166888405535`", ",", 
         "0.2948692029351611`", ",", "0.9525589249513784`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.8809679219531704`", ",", "0.891721457973351`", ",", 
         "0.7832128936050231`", ",", "0.013266982771290266`", ",", 
         "0.4271267432797005`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}]}], "}"}], ",", 
       "0.6424316356526102`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "381.75058972284495`"}], ",", 
       RowBox[{"-", "371.92264502224623`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.3083234993357692`", ",", "0.14916741384476495`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6327279580763073`", ",", "0.22706936138170264`", ",", 
         "0.7383245216434422`", ",", "0.22884482905140752`", ",", 
         "0.043832253225592074`", ",", "0.05786969804480247`", ",", 
         "0.6109989974732202`", ",", "0.28127179919280476`", ",", 
         "0.8662873798216482`", ",", "0.4504760311547151`", ",", 
         "0.3344574929804091`", ",", "0.6201199071937218`", ",", 
         "0.18409869247003852`", ",", "0.9853743622706597`", ",", 
         "0.039588290045247984`", ",", "0.6675609822423433`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.30313077051686804`", ",", "0.09365290429730874`", ",", 
         "0.25637539644022483`", ",", "0.654293999471053`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.8760040272371675`", ",", "0.4512212686446985`", ",", 
         "0.9480518971044556`", ",", "0.5051265856262881`", ",", 
         "0.24327606916086017`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}]}], "}"}], ",", 
       "0.2241519072629959`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "87.83211891719706`"}], ",", 
       RowBox[{"-", "64.23761074207953`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.20972737546101344`", ",", "0.2762817565748806`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.19944381593526808`", ",", "0.16628220921819342`", ",", 
         "0.5987283779877932`", ",", "0.9950099573820758`", ",", 
         "0.33315643611362`", ",", "0.7158061780634783`", ",", 
         "0.26427088500738416`", ",", "0.3748900501883541`", ",", 
         "0.14905774364358146`", ",", "0.7304318157928187`", ",", 
         "0.2246825949621362`", ",", "0.7073290679460108`", ",", 
         "0.8459269731267134`", ",", "0.6367789114955099`", ",", 
         "0.9683071985219114`", ",", "0.05303506847495773`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9699229458895459`", ",", "0.18555764285081136`", ",", 
         "0.020255301417455754`", ",", "0.5479084828486697`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7266468767286858`", ",", "0.9614057355878155`", ",", 
         "0.8105279259564423`", ",", "0.2716267262737891`", ",", 
         "0.5272030607934176`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.795123526369622`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "186.83068495754824`"}], ",", 
       RowBox[{"-", "166.98162304210473`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.21179954796864903`", ",", "0.27661676889171327`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.19404662467979766`", ",", "0.07931734830614366`", ",", 
         "0.9475286629612648`", ",", "0.9017267187033592`", ",", 
         "0.044988881036216184`", ",", "0.348885532513325`", ",", 
         "0.7228460679991286`", ",", "0.19439765075734847`", ",", 
         "0.19906190790950276`", ",", "0.7121066210178151`", ",", 
         "0.7545388694772173`", ",", "0.14136258228239074`", ",", 
         "0.22913896201995687`", ",", "0.5265489781670037`", ",", 
         "0.7342835680597616`", ",", "0.5934540994337211`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5024920852912711`", ",", "0.5651432425791882`", ",", 
         "0.9237556421033193`", ",", "0.321827373159932`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9752890244978535`", ",", "0.7700197162095662`", ",", 
         "0.7119560941346702`", ",", "0.04521060426821872`", ",", 
         "0.7812423998180559`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.6907023679034225`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "216.15190312515725`"}], ",", 
       RowBox[{"-", "197.8473801004964`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.7644274311734054`", ",", "0.1434838855648595`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7362535187818396`", ",", "0.34181683539009755`", ",", 
         "0.04158136317427668`", ",", "0.949086234807511`", ",", 
         "0.5371916108723369`", ",", "0.6297102143722825`", ",", 
         "0.28704249369705936`", ",", "0.8077236525251202`", ",", 
         "0.30805264885238004`", ",", "0.1031612362052787`", ",", 
         "0.5527589256372978`", ",", "0.2142695530913992`", ",", 
         "0.8055605635611089`", ",", "0.5380179936260905`", ",", 
         "0.6290032835339785`", ",", "0.8924421799314671`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.8302715390632553`", ",", "0.7679982774165243`", ",", 
         "0.9170471893993083`", ",", "0.8472315756632485`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.049029139245199534`", ",", "0.0772959095131017`", ",", 
         "0.15261975822590296`", ",", "0.703747690098389`", ",", 
         "0.3127756204633599`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}]}], "}"}], ",", 
       "0.7354790741230042`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "34.3037811375431`"}], ",", 
       RowBox[{"-", "25.21020126081033`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.11103839505162628`", ",", "0.7546614552908779`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7755840095910229`", ",", "0.10576885975072173`", ",", 
         "0.8239959013545669`", ",", "0.9469378027657577`", ",", 
         "0.4675313607386429`", ",", "0.0026076235454430214`", ",", 
         "0.2712369757172691`", ",", "0.7326682496743585`", ",", 
         "0.6619707971775339`", ",", "0.4645896299193526`", ",", 
         "0.6422336921832905`", ",", "0.8402260697428913`", ",", 
         "0.8316992581142786`", ",", "0.6965913525028283`", ",", 
         "0.7251865027839822`", ",", "0.9929944940796429`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7826701188690791`", ",", "0.6192954429897266`", ",", 
         "0.5725667445580792`", ",", "0.2892468039812539`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.46989449840571923`", ",", "0.8838163688667224`", ",", 
         "0.461528349506453`", ",", "0.534585348690376`", ",", 
         "0.6943104888146963`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"1", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}]}], "}"}], ",", 
       "0.7780475091160007`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "185.0359521303834`"}], ",", 
       RowBox[{"-", "171.79809622966897`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.637532448151886`", ",", "0.5876475459246183`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.22677912807605338`", ",", "0.7754398855705578`", ",", 
         "0.36629547243461696`", ",", "0.8549792962502598`", ",", 
         "0.5648083308985193`", ",", "0.31085025565120517`", ",", 
         "0.7240617802513264`", ",", "0.014753226507368458`", ",", 
         "0.7331090727842408`", ",", "0.6142589031483768`", ",", 
         "0.9988752774673442`", ",", "0.021758732427725594`", ",", 
         "0.9504389539151618`", ",", "0.9949634601586502`", ",", 
         "0.4263085329092649`", ",", "0.7325119284464717`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.4805444555094425`", ",", "0.11114709129192771`", ",", 
         "0.9647801834028119`", ",", "0.19792657975609576`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7862339666947463`", ",", "0.33309958217592694`", ",", 
         "0.3272477352509259`", ",", "0.6102790338314775`", ",", 
         "0.5594548386186929`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.5576596966053693`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "149.56585149512352`"}], ",", 
       RowBox[{"-", "137.7188301178076`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.960952262816309`", ",", "0.7552997375812177`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9946465077201735`", ",", "0.2468094409541641`", ",", 
         "0.23689048256498252`", ",", "0.7405465110738493`", ",", 
         "0.2615374349359327`", ",", "0.6325505378057873`", ",", 
         "0.23801520509763832`", ",", "0.7187877786461236`", ",", 
         "0.311098481020771`", ",", "0.6375870776471371`", ",", 
         "0.8117066721883734`", ",", "0.9862758501996519`", ",", 
         "0.8305540255113284`", ",", "0.5264399863552094`", ",", 
         "0.8469264887855614`", ",", "0.7883492704435562`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.044320058816582145`", ",", "0.19334040417928242`", ",", 
         "0.5196787535346357`", ",", "0.17807023661207871`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.48486522019788925`", ",", "0.6356807075739132`", ",", 
         "0.5587264907183267`", ",", "0.422770499030861`", ",", 
         "0.49021871247771576`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.3888712666197491`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "127.49268618049956`"}], ",", 
       RowBox[{"-", "113.04413811006735`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.3218360081533442`", ",", "0.6822239879570118`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.22868127754178302`", ",", "0.7563207288139618`", ",", 
         "0.08382080305570584`", ",", "0.9634362093108881`", ",", 
         "0.917582796521012`", ",", "0.1187336511668247`", ",", 
         "0.27211413086733244`", ",", "0.9771603591112361`", ",", 
         "0.08702877100968366`", ",", "0.5922936648116154`", ",", 
         "0.42518764208177096`", ",", "0.18881108866767993`", ",", 
         "0.04270871219310152`", ",", "0.39895326063233294`", ",", 
         "0.9055088885471353`", ",", "0.010740852055601213`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5578434919952123`", ",", "0.7632725530584198`", ",", 
         "0.34678239782880865`", ",", "0.5879703530247402`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.06762477951749654`", ",", "0.3744012864386707`", ",", 
         "0.024946389675464465`", ",", "0.9057463650677284`", ",", 
         "0.8389435019757135`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}]}], "}"}], ",", 
       "0.6180805576247089`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "141.5975146212512`"}], ",", 
       RowBox[{"-", "131.84602947459024`"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.9411255866197586`", ",", "0.9423101557568404`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9213607054547014`", ",", "0.49934690645788415`", ",", 
         "0.6690114557524262`", ",", "0.9651497966456043`", ",", 
         "0.8343319344450177`", ",", "0.9070532416462689`", ",", 
         "0.24382381367065525`", ",", "0.7763387079779244`", ",", 
         "0.7916232222519163`", ",", "0.5080999810139359`", ",", 
         "0.3383149251235199`", ",", "0.7655978559223231`", ",", 
         "0.23377973025670395`", ",", "0.7448274279555162`", ",", 
         "0.9915325272947113`", ",", "0.17762750289758292`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.16615495073920744`", ",", "0.3704261415168455`", ",", 
         "0.9665861376192468`", ",", "0.27188113782985446`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.32721144876349395`", ",", "0.7523455838921366`", ",", 
         "0.025460550999488178`", ",", "0.32957098207301405`", ",", 
         "0.4058507433087925`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.2529986774342524`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "222.46009589154832`"}], ",", 
       RowBox[{"-", "217.70073076473753`"}]}], "}"}]}], "}"}]}], 
  "}"}]], "Output",
 CellChangeTimes->{
  3.526412652972857*^9, 3.52641269400252*^9, {3.5264128496081448`*^9, 
   3.52641286549189*^9}, 3.526412978070984*^9, 3.526413030610743*^9, 
   3.526413072023435*^9, 3.5264131800918207`*^9, {3.526413217870302*^9, 
   3.526413282891789*^9}, 3.5264133159519577`*^9, {3.526413430154264*^9, 
   3.526413435298602*^9}, 3.5264137003023787`*^9, 3.526413731686533*^9, 
   3.526414085926256*^9, 3.5264276576259403`*^9, {3.526430663343699*^9, 
   3.526430668466977*^9}, 3.5264307454436893`*^9, 3.527038804304483*^9}]
}, Open  ]]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell["dqfuncd\[Tau] and dqfuncdqlog\[Lambda]", "Subsection",
 CellChangeTimes->{{3.525095319326301*^9, 3.525095320059371*^9}, {
  3.52509801721535*^9, 3.525098017925005*^9}, {3.525181353753007*^9, 
  3.525181356624176*^9}, {3.525181497944603*^9, 3.525181498071718*^9}, {
  3.5265179194497232`*^9, 3.526517932232986*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "makevararray", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"makevararray", "[", 
    RowBox[{"s_", ",", " ", "n_"}], "]"}], " ", ":=", " ", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"ToExpression", "[", 
      RowBox[{"s", " ", "<>", " ", 
       RowBox[{"ToString", "[", "i", "]"}]}], "]"}], ",", " ", 
     RowBox[{"{", " ", 
      RowBox[{"i", ",", " ", "1", ",", " ", "n"}], " ", "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "makevarmatrix", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"makevarmatrix", "[", 
    RowBox[{"s_", ",", " ", "m_", ",", " ", "n_"}], "]"}], " ", ":=", " ", 
   "\[IndentingNewLine]", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"makevararray", "[", 
      RowBox[{
       RowBox[{"s", "<>", " ", 
        RowBox[{"ToString", "[", "i", "]"}]}], ",", " ", "n"}], "]"}], ",", 
     " ", 
     RowBox[{"{", " ", 
      RowBox[{"i", ",", " ", "1", ",", " ", "m"}], " ", "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "dqfuncd\[Tau]", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"dqfuncd\[Tau]", "[", 
    RowBox[{
    "\[Kappa]_", ",", " ", "log\[Alpha]_", ",", " ", "\[Tau]_", ",", " ", 
     "log\[Lambda]_", ",", " ", "pz_", ",", "d_", ",", " ", "plog\[Alpha]_"}],
     "]"}], " ", ":=", " ", 
   RowBox[{
    RowBox[{"D", "[", 
     RowBox[{
      RowBox[{"qfunc", "[", 
       RowBox[{"\[Kappa]", ",", " ", "log\[Alpha]", ",", " ", 
        RowBox[{"makevarmatrix", "[", 
         RowBox[{"\"\<\[Tau]\>\"", ",", " ", 
          RowBox[{"Length", "[", "\[Tau]", "]"}], ",", " ", 
          RowBox[{"Length", "[", 
           RowBox[{"\[Tau]", "[", 
            RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "]"}], ",", " ", 
        "log\[Lambda]", ",", " ", "pz", ",", "d", ",", " ", "plog\[Alpha]"}], 
       "]"}], ",", " ", 
      RowBox[{"{", "  ", 
       RowBox[{"makevarmatrix", "[", 
        RowBox[{"\"\<\[Tau]\>\"", ",", " ", 
         RowBox[{"Length", "[", "\[Tau]", "]"}], ",", " ", 
         RowBox[{"Length", "[", 
          RowBox[{"\[Tau]", "[", 
           RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "]"}], " ", "}"}]}], 
     "]"}], " ", "/.", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{
       RowBox[{"ToExpression", "[", 
        RowBox[{
         RowBox[{"ToString", "[", 
          RowBox[{"#", "[", 
           RowBox[{"[", "1", "]"}], "]"}], "]"}], " ", "<>", " ", 
         "\"\< -> \>\"", " ", "<>", " ", 
         RowBox[{"ToString", "[", 
          RowBox[{"#", "[", 
           RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "]"}], "&"}], " ", "/@", 
      RowBox[{"Transpose", "[", 
       RowBox[{"{", " ", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"Flatten", "[", 
          RowBox[{"makevarmatrix", "[", 
           RowBox[{"\"\<\[Tau]\>\"", ",", " ", 
            RowBox[{"Length", "[", "\[Tau]", "]"}], ",", " ", 
            RowBox[{"Length", "[", 
             RowBox[{"\[Tau]", "[", 
              RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "]"}], "]"}], ",", 
         RowBox[{"Flatten", "[", 
          RowBox[{"Table", "[", 
           RowBox[{
            RowBox[{"\[Tau]", "[", 
             RowBox[{"[", 
              RowBox[{"i", ",", " ", "j"}], "]"}], "]"}], ",", " ", 
            RowBox[{"{", " ", 
             RowBox[{"i", ",", " ", "1", ",", " ", 
              RowBox[{"Length", "[", "\[Tau]", "]"}]}], "}"}], ",", " ", 
            RowBox[{"{", " ", 
             RowBox[{"j", ",", " ", "1", ",", " ", 
              RowBox[{"Length", "[", 
               RowBox[{"\[Tau]", "[", 
                RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], 
          "]"}]}], "}"}], "]"}]}], ")"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "dqfuncdlog\[Lambda]", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"dqfuncdlog\[Lambda]", "[", 
    RowBox[{
    "\[Kappa]_", ",", " ", "log\[Alpha]_", ",", " ", "\[Tau]_", ",", " ", 
     "log\[Lambda]_", ",", " ", "pz_", ",", "d_", ",", " ", "plog\[Alpha]_"}],
     "]"}], " ", ":=", " ", 
   RowBox[{
    RowBox[{"D", "[", 
     RowBox[{
      RowBox[{"qfunc", "[", 
       RowBox[{"\[Kappa]", ",", " ", "log\[Alpha]", ",", "\[Tau]", ",", " ", 
        RowBox[{"makevararray", "[", 
         RowBox[{"\"\<log\[Lambda]\>\"", ",", " ", 
          RowBox[{"Length", "[", "log\[Lambda]", "]"}]}], "]"}], ",", "pz", 
        ",", "d", ",", " ", "plog\[Alpha]"}], "]"}], ",", " ", 
      RowBox[{"{", "  ", 
       RowBox[{"makevararray", "[", 
        RowBox[{"\"\<log\[Lambda]\>\"", ",", " ", 
         RowBox[{"Length", "[", "log\[Lambda]", "]"}]}], "]"}], " ", "}"}]}], 
     "]"}], " ", "/.", " ", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{
       RowBox[{"ToExpression", "[", 
        RowBox[{
         RowBox[{"ToString", "[", 
          RowBox[{"#", "[", 
           RowBox[{"[", "1", "]"}], "]"}], "]"}], " ", "<>", " ", 
         "\"\< -> \>\"", " ", "<>", " ", 
         RowBox[{"ToString", "[", 
          RowBox[{"#", "[", 
           RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "]"}], "&"}], " ", "/@", 
      RowBox[{"Transpose", "[", 
       RowBox[{"{", " ", 
        RowBox[{
         RowBox[{"makevararray", "[", 
          RowBox[{"\"\<log\[Lambda]\>\"", ",", " ", 
           RowBox[{"Length", "[", "log\[Lambda]", "]"}]}], "]"}], ",", 
         "log\[Lambda]"}], " ", "}"}], "]"}]}], ")"}]}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.5265625751603403`*^9, 3.52656264492064*^9}, {
  3.526562676614012*^9, 3.52656286068789*^9}, {3.5265629411796217`*^9, 
  3.526563034031913*^9}}],

Cell[CellGroupData[{

Cell["Test Vectors for dqfunc", "Subsubsection",
 CellChangeTimes->{{3.50401932583255*^9, 3.504019328703233*^9}, {
  3.504185890254962*^9, 3.504185890709035*^9}, {3.5042036574835863`*^9, 
  3.504203657569166*^9}, {3.504916768505199*^9, 3.504916769023423*^9}, {
  3.5264122361917953`*^9, 3.526412241984367*^9}, {3.52656288649238*^9, 
  3.52656288710295*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "nworkers", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nworkers", " ", "=", " ", "4"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nlabels", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nlabels", " ", "=", " ", "5"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nratings", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nratings", " ", "=", " ", "8"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", " ", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
          RowBox[{"ListQ", "[", "#", "]"}], " ", "&&", " ", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"!", " ", 
             RowBox[{"ListQ", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "]"}]}], " ", "||", " ", 
            RowBox[{"!", " ", 
             RowBox[{"IntegerQ", "[", 
              RowBox[{
               RowBox[{"#", "[", 
                RowBox[{"[", "1", "]"}], "]"}], "[", 
               RowBox[{"[", "1", "]"}], "]"}], "]"}]}]}], ")"}]}], ",", " ", 
         RowBox[{"Flatten", "[", "#", "]"}], ",", " ", "#"}], "]"}], "&"}], 
      " ", "/@", " ", "#"}], ",", " ", "\[IndentingNewLine]", 
     RowBox[{"{", " ", 
      RowBox[{
       RowBox[{
        RowBox[{"dqfuncd\[Tau]", "[", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{"#", "[", 
           RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
          RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
          RowBox[{"#", "[", 
           RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
          RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], 
          "\[IndentingNewLine]", 
          RowBox[{"Table", "[", 
           RowBox[{
            RowBox[{"Table", "[", 
             RowBox[{
              RowBox[{"j", "  ", "-", " ", "0.5", " ", "+", " ", 
               RowBox[{
                RowBox[{
                 RowBox[{"#", "[", 
                  RowBox[{"[", "3", "]"}], "]"}], "[", 
                 RowBox[{"[", "k", "]"}], "]"}], "[", 
                RowBox[{"[", "j", "]"}], "]"}]}], ",", 
              RowBox[{"{", " ", 
               RowBox[{"j", ",", " ", "1", ",", " ", 
                RowBox[{"Length", "[", 
                 RowBox[{
                  RowBox[{"#", "[", 
                   RowBox[{"[", "3", "]"}], "]"}], "[", 
                  RowBox[{"[", "k", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], 
            ",", " ", 
            RowBox[{"{", " ", 
             RowBox[{"k", ",", " ", "1", ",", " ", 
              RowBox[{"Length", "[", 
               RowBox[{"#", "[", 
                RowBox[{"[", "3", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", 
          
          RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
          RowBox[{"#", "[", 
           RowBox[{"[", "4", "]"}], "]"}], ",", " ", 
          RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], 
          "\[IndentingNewLine]", 
          RowBox[{"#", "[", 
           RowBox[{"[", "5", "]"}], "]"}], ",", " ", 
          RowBox[{"(*", " ", "pz", " ", "*)"}], "\[IndentingNewLine]", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{
             RowBox[{"{", 
              RowBox[{
               RowBox[{"1", "+", 
                RowBox[{"#", "[", 
                 RowBox[{"[", "1", "]"}], "]"}]}], ",", 
               RowBox[{"#", "[", 
                RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "&"}], " ", "/@", 
            " ", 
            RowBox[{"#", "[", 
             RowBox[{"[", "6", "]"}], "]"}]}], ")"}], ",", " ", 
          RowBox[{"(*", " ", "d", " ", "*)"}], 
          RowBox[{"Function", "[", 
           RowBox[{"x", ",", " ", 
            RowBox[{"NormalDistribution", "[", 
             RowBox[{"x", ",", " ", 
              RowBox[{"#", "[", 
               RowBox[{"[", "7", "]"}], "]"}]}], "]"}]}], "]"}]}], " ", 
         RowBox[{"(*", " ", "plog\[Alpha]", " ", "*)"}], 
         "\[IndentingNewLine]", "]"}], " ", "//", " ", "Flatten"}], ",", 
       "\[IndentingNewLine]", 
       RowBox[{"dqfuncdlog\[Lambda]", "[", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"#", "[", 
          RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"Table", "[", 
            RowBox[{
             RowBox[{"j", "  ", "-", " ", "0.5", " ", "+", " ", 
              RowBox[{
               RowBox[{
                RowBox[{"#", "[", 
                 RowBox[{"[", "3", "]"}], "]"}], "[", 
                RowBox[{"[", "k", "]"}], "]"}], "[", 
               RowBox[{"[", "j", "]"}], "]"}]}], ",", 
             RowBox[{"{", " ", 
              RowBox[{"j", ",", " ", "1", ",", " ", 
               RowBox[{"Length", "[", 
                RowBox[{
                 RowBox[{"#", "[", 
                  RowBox[{"[", "3", "]"}], "]"}], "[", 
                 RowBox[{"[", "k", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",",
            " ", 
           RowBox[{"{", " ", 
            RowBox[{"k", ",", " ", "1", ",", " ", 
             RowBox[{"Length", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "3", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", 
         RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "4", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], 
         "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "5", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "pz", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{
            RowBox[{"{", 
             RowBox[{
              RowBox[{"1", "+", 
               RowBox[{"#", "[", 
                RowBox[{"[", "1", "]"}], "]"}]}], ",", 
              RowBox[{"#", "[", 
               RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "&"}], " ", "/@", " ", 
           RowBox[{"#", "[", 
            RowBox[{"[", "6", "]"}], "]"}]}], ")"}], ",", " ", 
         RowBox[{"(*", " ", "d", " ", "*)"}], 
         RowBox[{"Function", "[", 
          RowBox[{"x", ",", " ", 
           RowBox[{"NormalDistribution", "[", 
            RowBox[{"x", ",", " ", 
             RowBox[{"#", "[", 
              RowBox[{"[", "7", "]"}], "]"}]}], "]"}]}], "]"}]}], " ", 
        RowBox[{"(*", " ", "plog\[Alpha]", " ", "*)"}], "\[IndentingNewLine]",
         "]"}]}], "\[IndentingNewLine]", "}"}]}], "\[IndentingNewLine]", 
    "}"}], "&"}], "/@", "\[IndentingNewLine]", 
  RowBox[{"Table", "[", 
   RowBox[{
    RowBox[{"{", " ", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Random", "[", "]"}], ",", " ", 
      RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Random", "[", "]"}], ",", " ", 
      RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Random", "[", "]"}], ",", " ", 
          RowBox[{"{", " ", 
           RowBox[{"i", ",", " ", "1", ",", " ", 
            RowBox[{"nlabels", " ", "-", " ", "1"}]}], "}"}]}], "]"}], ",", 
        " ", 
        RowBox[{"{", " ", 
         RowBox[{"k", ",", " ", "1", ",", " ", "nworkers"}], "}"}]}], "]"}], 
      ",", " ", 
      RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nworkers"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nlabels"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "pz", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"{", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{"Random", "[", 
           RowBox[{"Integer", ",", " ", 
            RowBox[{"nworkers", " ", "-", " ", "1"}]}], "]"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"Random", "[", 
           RowBox[{"Integer", ",", " ", 
            RowBox[{"nlabels", " ", "-", " ", "1"}]}], "]"}]}], 
         "\[IndentingNewLine]", "}"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nratings"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "d", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Random", "[", "]"}]}], " ", 
     RowBox[{"(*", " ", 
      RowBox[{"plog\[Alpha]", " ", "stddev"}], " ", "*)"}], 
     "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{"{", " ", 
     RowBox[{"foo", ",", " ", "1", ",", " ", "5"}], " ", "}"}]}], 
   "]"}]}]}], "Input",
 CellChangeTimes->{{3.504016424813343*^9, 3.504016580297758*^9}, {
   3.504018269599441*^9, 3.504018279219314*^9}, {3.504018359153508*^9, 
   3.504018387475568*^9}, {3.5040184327040863`*^9, 3.504018509500141*^9}, {
   3.504018861653284*^9, 3.504018920277594*^9}, {3.504019049785894*^9, 
   3.504019065803638*^9}, 3.504019184180941*^9, {3.504059801963703*^9, 
   3.504059813764331*^9}, 3.5040599982883453`*^9, {3.504060100407703*^9, 
   3.504060104803857*^9}, 3.504060440796597*^9, {3.504060503267675*^9, 
   3.504060525182757*^9}, {3.50456047953319*^9, 3.504560681387557*^9}, {
   3.504577463729417*^9, 3.504577464011519*^9}, {3.504577589051256*^9, 
   3.504577590132493*^9}, {3.504577632742776*^9, 3.5045776330605373`*^9}, {
   3.504740502012248*^9, 3.504740503922497*^9}, {3.504740727150861*^9, 
   3.504740736352736*^9}, 3.504876469621917*^9, {3.5055962008030443`*^9, 
   3.505596275077857*^9}, {3.505596319880871*^9, 3.505596373226162*^9}, {
   3.505596415459552*^9, 3.505596505766666*^9}, {3.50559654044011*^9, 
   3.505596540734797*^9}, 3.505672802683957*^9, 3.5056942774993753`*^9, {
   3.505694366620678*^9, 3.505694366726482*^9}, {3.5057600362594757`*^9, 
   3.5057600462592773`*^9}, 3.505760218072028*^9, {3.5057618784831467`*^9, 
   3.5057618855096197`*^9}, {3.505765314690784*^9, 3.505765460997046*^9}, {
   3.505765519815023*^9, 3.505765560295491*^9}, 3.505765708877458*^9, {
   3.5059422297177*^9, 3.50594224933794*^9}, {3.5059422915411587`*^9, 
   3.5059423868650618`*^9}, {3.505942419849204*^9, 3.505942458271961*^9}, 
   3.506003797955632*^9, 3.522544655482306*^9, 3.522544695510792*^9, {
   3.526412258232821*^9, 3.5264124297647047`*^9}, {3.526412534152213*^9, 
   3.526412549418888*^9}, {3.526412580963234*^9, 3.526412612442492*^9}, {
   3.52641284537436*^9, 3.526412862526091*^9}, {3.526412977275703*^9, 
   3.526412977409284*^9}, {3.5264130300128517`*^9, 3.526413071567891*^9}, {
   3.5264131895823917`*^9, 3.5264131965298567`*^9}, {3.5264133128542147`*^9, 
   3.526413315530311*^9}, {3.526413392188962*^9, 3.5264134345921392`*^9}, {
   3.526413727365831*^9, 3.526413730697576*^9}, {3.52641407631104*^9, 
   3.526414085568967*^9}, 3.526430667444561*^9, 3.52643074409554*^9, {
   3.526562890803769*^9, 3.526562909342167*^9}, {3.526563039918169*^9, 
   3.5265630452180443`*^9}, {3.526563122063406*^9, 3.5265631259244967`*^9}, 
   3.526564681019143*^9, 3.52656472738325*^9, {3.52703889641495*^9, 
   3.52703889982553*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.356449095247062`", ",", "0.36442118542740976`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5715188088637747`", ",", "0.3459454357879836`", ",", 
         "0.11262528157640674`", ",", "0.5880824774494854`", ",", 
         "0.7798955866118585`", ",", "0.8378454547740477`", ",", 
         "0.7743103564528868`", ",", "0.8224846215271623`", ",", 
         "0.5461158563551546`", ",", "0.09301802681853148`", ",", 
         "0.7827778291581755`", ",", "0.6448571186295794`", ",", 
         "0.3799609056159471`", ",", "0.722591885301686`", ",", 
         "0.8161916915389288`", ",", "0.37297598079972494`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.05274945685245318`", ",", "0.9702463014095494`", ",", 
         "0.7907311405394406`", ",", "0.04340499872671088`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6468987135436607`", ",", "0.717247623975297`", ",", 
         "0.43428204529237857`", ",", "0.6789838132993011`", ",", 
         "0.07537990467988591`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.3713021881873134`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "2.740989001992565`"}], ",", 
         RowBox[{"-", "4.505044391121149`"}], ",", "1.791249721643593`", ",", 
         "0.32314297097422434`", ",", 
         RowBox[{"-", "3.9237843853309777`"}], ",", 
         RowBox[{"-", "10.192821377953575`"}], ",", 
         RowBox[{"-", "6.957321912212928`"}], ",", 
         RowBox[{"-", "9.498958224408947`"}], ",", 
         RowBox[{"-", "3.1367336831622468`"}], ",", 
         RowBox[{"-", "4.501527871232367`"}], ",", 
         RowBox[{"-", "7.230047590765389`"}], ",", 
         RowBox[{"-", "8.00048893838425`"}], ",", 
         RowBox[{"-", "2.558825755965534`"}], ",", 
         RowBox[{"-", "4.997374691293627`"}], ",", 
         RowBox[{"-", "6.647043673268932`"}], ",", 
         RowBox[{"-", "7.405045155488109`"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "7.063563397915452`"}], ",", 
         RowBox[{"-", "78.64564545272468`"}], ",", 
         RowBox[{"-", "41.70143689198037`"}], ",", 
         RowBox[{"-", "38.948170656529314`"}]}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.32165676371597185`", ",", "0.09090133584981569`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.2954843180680274`", ",", "0.5334567334132657`", ",", 
         "0.547346407263085`", ",", "0.2684167143226534`", ",", 
         "0.7493684617128729`", ",", "0.4404387065947343`", ",", 
         "0.7645685781049095`", ",", "0.6235595956930741`", ",", 
         "0.3694075560969257`", ",", "0.7178468212930483`", ",", 
         "0.9483768865659807`", ",", "0.2505836148933491`", ",", 
         "0.3166580992444726`", ",", "0.7476005198834988`", ",", 
         "0.15764574602654013`", ",", "0.2071786161666382`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.669759385700812`", ",", "0.030352895908201886`", ",", 
         "0.7233637007341616`", ",", "0.5281948028673371`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.594379481020926`", ",", "0.6590507077208885`", ",", 
         "0.40170693701818966`", ",", "0.4372934670175214`", ",", 
         "0.2988951629528986`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}]}], "}"}], ",", 
       "0.1255939743076227`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "1.870107137655606`", ",", "4.0661567313841`", ",", 
         "2.217647420347086`", ",", "0.9068830807926658`", ",", 
         "0.7554181171590065`", ",", "2.1773312647213388`", ",", 
         "1.05318150336411`", ",", "0.3475903778211285`", ",", 
         "7.13658914883927`", ",", "3.8895545544731798`", ",", 
         "1.7752956004118505`", ",", "0.8599507942654753`", ",", 
         RowBox[{"-", "2.8527732888423896`"}], ",", 
         RowBox[{"-", "1.03872857952835`"}], ",", 
         RowBox[{"-", "2.1422647861290187`"}], ",", "0.9131726246443124`"}], 
        "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "10.92299593903071`"}], ",", 
         RowBox[{"-", "4.484064651184251`"}], ",", 
         RowBox[{"-", "14.35284982545701`"}], ",", 
         RowBox[{"-", "12.69939606359037`"}]}], "}"}]}], "}"}]}], "}"}], ",", 
   
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.8543605297551047`", ",", "0.16887675269486804`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5495267012400258`", ",", "0.6851552677128885`", ",", 
         "0.08979195165019516`", ",", "0.5453171570017941`", ",", 
         "0.1801191451431`", ",", "0.9673084464198402`", ",", 
         "0.14141506508421445`", ",", "0.2947335421084449`", ",", 
         "0.8634610458986275`", ",", "0.21970792653634127`", ",", 
         "0.9837693190576743`", ",", "0.08755492594180668`", ",", 
         "0.19370166019781554`", ",", "0.18935503062813938`", ",", 
         "0.2604056183235128`", ",", "0.5593601230744696`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5993221791768896`", ",", "0.5303043229072509`", ",", 
         "0.8586986813053231`", ",", "0.12206665605694812`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.30042701622399093`", ",", "0.40471034859962823`", ",", 
         "0.004338151550218469`", ",", "0.9531899033620801`", ",", 
         "0.7509003149839651`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}]}], "}"}], ",", 
       "0.7195550808867398`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1.0800434122611864`", ",", 
         RowBox[{"-", "1.145878125408946`"}], ",", "1.626181691087753`", ",", 
         "3.5457072120122923`", ",", "0", ",", "0", ",", "0", ",", "0", ",", 
         "1.872312955287387`", ",", "0.7684338923306278`", ",", 
         RowBox[{"-", "5.685810204347439`"}], ",", 
         RowBox[{"-", "1.918208974236348`"}], ",", 
         RowBox[{"-", "0.45453109677383885`"}], ",", 
         RowBox[{"-", "0.9050791275277112`"}], ",", "1.675895651578551`", ",",
          "0.584477634269824`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "32.52470032574534`"}], ",", "0", ",", 
         RowBox[{"-", "47.42152063767363`"}], ",", 
         RowBox[{"-", "2.0801853549080036`"}]}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.9145461999000233`", ",", "0.4078727463602861`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5707811698408652`", ",", "0.7522466344668997`", ",", 
         "0.7731311348158089`", ",", "0.11313920425184118`", ",", 
         "0.7073201239422378`", ",", "0.5325387079305584`", ",", 
         "0.7893618157581346`", ",", "0.025584278310034497`", ",", 
         "0.5136184637444222`", ",", "0.34318367730241894`", ",", 
         "0.5289561974346217`", ",", "0.46622415523556493`", ",", 
         "0.9142962845675326`", ",", "0.812879354395168`", ",", 
         "0.6702575161292987`", ",", "0.3441574991786168`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6138692683435417`", ",", "0.40816900579553983`", ",", 
         "0.6659193645790802`", ",", "0.39096759581653673`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.8629689533595766`", ",", "0.6886139249088`", ",", 
         "0.7513731646790569`", ",", "0.9830948494562507`", ",", 
         "0.29218778351871133`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}]}], "}"}], ",", 
       "0.9363672904419004`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "10.250935147555916`"}], ",", 
         RowBox[{"-", "7.771461196055312`"}], ",", 
         RowBox[{"-", "14.767777049920682`"}], ",", 
         RowBox[{"-", "7.768277692555049`"}], ",", 
         RowBox[{"-", "2.88856203799777`"}], ",", 
         RowBox[{"-", "4.51645876354126`"}], ",", 
         RowBox[{"-", "6.58137614676979`"}], ",", "0.6658839091193269`", ",", 
         "3.6053677970746807`", ",", 
         RowBox[{"-", "0.254159751156414`"}], ",", "4.580610227230236`", ",", 
         "1.029265384529641`", ",", 
         RowBox[{"-", "6.349836426159521`"}], ",", 
         RowBox[{"-", "9.687260750902158`"}], ",", 
         RowBox[{"-", "4.952424308233369`"}], ",", 
         RowBox[{"-", "7.012368442215083`"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "76.0273584388888`"}], ",", 
         RowBox[{"-", "20.315871950382537`"}], ",", 
         RowBox[{"-", "25.289545198077615`"}], ",", 
         RowBox[{"-", "47.30260763558626`"}]}], "}"}]}], "}"}]}], "}"}], ",", 
   
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.978242029863248`", ",", "0.8699556452044095`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5848676595764736`", ",", "0.40382858251134207`", ",", 
         "0.18888021410511346`", ",", "0.844371366894375`", ",", 
         "0.07124919583205137`", ",", "0.06064490520892315`", ",", 
         "0.6599240166704917`", ",", "0.37814721165881005`", ",", 
         "0.15695291126451869`", ",", "0.24776555081375512`", ",", 
         "0.989666500541193`", ",", "0.033989712480193224`", ",", 
         "0.543083642920977`", ",", "0.8395965450182153`", ",", 
         "0.3237471359621128`", ",", "0.6430221166636565`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6801146895614004`", ",", "0.15098262010941527`", ",", 
         "0.5723739712830559`", ",", "0.6599272672074059`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.38792690604268903`", ",", "0.21461532966751484`", ",", 
         "0.5941319414198079`", ",", "0.7899716220029964`", ",", 
         "0.8030592464662154`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}]}], "}"}], ",", 
       "0.8107867471561727`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
        "0", ",", "0", ",", "0", ",", "0", ",", "5.707187772472608`", ",", 
         "11.525831559406447`", ",", "6.166912321859188`", ",", 
         "2.645121651002129`", ",", 
         RowBox[{"-", "6.855856227846701`"}], ",", 
         RowBox[{"-", "0.9087462605343597`"}], ",", "3.2379031440532966`", 
         ",", "11.916224196402023`", ",", 
         RowBox[{"-", "4.696075728897153`"}], ",", "2.682084388000823`", ",", 
         "12.406799784470714`", ",", "2.544459390076183`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"0", ",", 
         RowBox[{"-", "37.38170980311571`"}], ",", 
         RowBox[{"-", "49.17483226889891`"}], ",", 
         RowBox[{"-", "27.494904601094966`"}]}], "}"}]}], "}"}]}], "}"}]}], 
  "}"}]], "Output",
 CellChangeTimes->{3.5265629107187557`*^9, 3.526563047690802*^9, 
  3.526563126587101*^9, 3.5265646822242413`*^9, 3.526564727985888*^9, 
  3.527038906473196*^9}]
}, Open  ]]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell["Mstep (log\[Alpha])", "Subsection",
 CellChangeTimes->{{3.525095319326301*^9, 3.525095320059371*^9}, {
  3.52509801721535*^9, 3.525098017925005*^9}, {3.525112791223256*^9, 
  3.525112791828678*^9}, {3.525115293972691*^9, 3.525115296179682*^9}, {
  3.5264923374180117`*^9, 3.526492338566841*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "mstep", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"mstep", "[", 
     RowBox[{
     "\[Kappa]_", ",", " ", "log\[Alpha]_", ",", " ", "\[Tau]_", ",", " ", 
      "log\[Lambda]_", ",", " ", "pz_", ",", "d_", ",", " ", 
      "plog\[Alpha]_"}], "]"}], " ", ":=", " ", 
    RowBox[{"Module", "[", 
     RowBox[{
      RowBox[{"{", " ", 
       RowBox[{"q", ",", " ", "vars", ",", " ", "log\[Alpha]new"}], " ", 
       "}"}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"{", " ", 
         RowBox[{"q", ",", " ", "vars"}], "}"}], " ", "=", " ", 
        "\[IndentingNewLine]", 
        RowBox[{"FindMaximum", "[", 
         RowBox[{
          RowBox[{"qfunc", "[", 
           RowBox[{
           "\[Kappa]", ",", " ", "log\[Alpha]new", ",", " ", "\[Tau]", ",", 
            " ", "log\[Lambda]", ",", " ", "pz", ",", "d", ",", " ", 
            "plog\[Alpha]"}], "]"}], ",", " ", 
          RowBox[{"{", 
           RowBox[{"log\[Alpha]new", ",", " ", "log\[Alpha]"}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"AccuracyGoal", " ", "\[Rule]", " ", "10"}], ",", " ", 
          RowBox[{"PrecisionGoal", "\[Rule]", "10"}], ",", " ", 
          RowBox[{"WorkingPrecision", "\[Rule]", " ", "20"}]}], 
         "\[IndentingNewLine]", "]"}]}], ";", "\[IndentingNewLine]", 
       RowBox[{"{", " ", 
        RowBox[{"q", ",", " ", 
         RowBox[{"log\[Alpha]new", " ", "/.", " ", "vars"}]}], " ", "}"}]}]}],
      "\[IndentingNewLine]", "]"}]}], ";"}], " "}]}], "Input",
 CellChangeTimes->{{3.525112845374671*^9, 3.525112988617275*^9}, {
  3.525113459603532*^9, 3.525113472249138*^9}, {3.525113554121476*^9, 
  3.525113581131281*^9}, {3.525113780579424*^9, 3.5251137888400583`*^9}, {
  3.525113825010914*^9, 3.525113825305956*^9}, {3.525204881040271*^9, 
  3.525204882117687*^9}, {3.525205322777459*^9, 3.525205343300995*^9}, {
  3.525205386747162*^9, 3.525205391547484*^9}, {3.526492369515942*^9, 
  3.526492416380603*^9}}],

Cell[CellGroupData[{

Cell["Test Vectors for mstep", "Subsubsection",
 CellChangeTimes->{{3.50401932583255*^9, 3.504019328703233*^9}, {
  3.504185890254962*^9, 3.504185890709035*^9}, {3.5042036574835863`*^9, 
  3.504203657569166*^9}, {3.504916768505199*^9, 3.504916769023423*^9}, {
  3.5264122361917953`*^9, 3.526412241984367*^9}, {3.526498353607053*^9, 
  3.526498354044754*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "nworkers", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nworkers", " ", "=", " ", "4"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nlabels", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nlabels", " ", "=", " ", "5"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nratings", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nratings", " ", "=", " ", "8"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", " ", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
          RowBox[{"ListQ", "[", "#", "]"}], " ", "&&", " ", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"!", " ", 
             RowBox[{"ListQ", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "1", "]"}], "]"}], "]"}]}], " ", "||", " ", 
            RowBox[{"!", " ", 
             RowBox[{"IntegerQ", "[", 
              RowBox[{
               RowBox[{"#", "[", 
                RowBox[{"[", "1", "]"}], "]"}], "[", 
               RowBox[{"[", "1", "]"}], "]"}], "]"}]}]}], ")"}]}], ",", " ", 
         RowBox[{"Flatten", "[", "#", "]"}], ",", " ", "#"}], "]"}], "&"}], 
      " ", "/@", " ", "#"}], ",", " ", "\[IndentingNewLine]", 
     RowBox[{"mstep", "[", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"#", "[", 
        RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
       RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
       RowBox[{"#", "[", 
        RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
       RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"j", "  ", "-", " ", "0.5", " ", "+", " ", 
            RowBox[{
             RowBox[{
              RowBox[{"#", "[", 
               RowBox[{"[", "3", "]"}], "]"}], "[", 
              RowBox[{"[", "k", "]"}], "]"}], "[", 
             RowBox[{"[", "j", "]"}], "]"}]}], ",", 
           RowBox[{"{", " ", 
            RowBox[{"j", ",", " ", "1", ",", " ", 
             RowBox[{"Length", "[", 
              RowBox[{
               RowBox[{"#", "[", 
                RowBox[{"[", "3", "]"}], "]"}], "[", 
               RowBox[{"[", "k", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", 
         " ", 
         RowBox[{"{", " ", 
          RowBox[{"k", ",", " ", "1", ",", " ", 
           RowBox[{"Length", "[", 
            RowBox[{"#", "[", 
             RowBox[{"[", "3", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", 
       RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
       RowBox[{"#", "[", 
        RowBox[{"[", "4", "]"}], "]"}], ",", " ", 
       RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], "\[IndentingNewLine]", 
       
       RowBox[{"#", "[", 
        RowBox[{"[", "5", "]"}], "]"}], ",", " ", 
       RowBox[{"(*", " ", "pz", " ", "*)"}], "\[IndentingNewLine]", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"{", 
           RowBox[{
            RowBox[{"1", "+", 
             RowBox[{"#", "[", 
              RowBox[{"[", "1", "]"}], "]"}]}], ",", 
            RowBox[{"#", "[", 
             RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "&"}], " ", "/@", " ", 
         RowBox[{"#", "[", 
          RowBox[{"[", "6", "]"}], "]"}]}], ")"}], ",", " ", 
       RowBox[{"(*", " ", "d", " ", "*)"}], 
       RowBox[{"Function", "[", 
        RowBox[{"x", ",", " ", 
         RowBox[{"NormalDistribution", "[", 
          RowBox[{"x", ",", " ", 
           RowBox[{"#", "[", 
            RowBox[{"[", "7", "]"}], "]"}]}], "]"}]}], "]"}]}], " ", 
      RowBox[{"(*", " ", "plog\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
      "]"}]}], "\[IndentingNewLine]", "}"}], "&"}], "/@", 
  "\[IndentingNewLine]", 
  RowBox[{"Table", "[", 
   RowBox[{
    RowBox[{"{", " ", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Random", "[", "]"}], ",", " ", 
      RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Random", "[", "]"}], ",", " ", 
      RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Random", "[", "]"}], ",", " ", 
          RowBox[{"{", " ", 
           RowBox[{"i", ",", " ", "1", ",", " ", 
            RowBox[{"nlabels", " ", "-", " ", "1"}]}], "}"}]}], "]"}], ",", 
        " ", 
        RowBox[{"{", " ", 
         RowBox[{"k", ",", " ", "1", ",", " ", "nworkers"}], "}"}]}], "]"}], 
      ",", " ", 
      RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nworkers"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nlabels"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "pz", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"{", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{"Random", "[", 
           RowBox[{"Integer", ",", " ", 
            RowBox[{"nworkers", " ", "-", " ", "1"}]}], "]"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"Random", "[", 
           RowBox[{"Integer", ",", " ", 
            RowBox[{"nlabels", " ", "-", " ", "1"}]}], "]"}]}], 
         "\[IndentingNewLine]", "}"}], ",", " ", 
        RowBox[{"{", " ", 
         RowBox[{"i", ",", " ", "1", ",", " ", "nratings"}], " ", "}"}]}], 
       "]"}], ",", " ", 
      RowBox[{"(*", " ", "d", " ", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"Random", "[", "]"}]}], " ", 
     RowBox[{"(*", " ", 
      RowBox[{"plog\[Alpha]", " ", "stddev"}], " ", "*)"}], 
     "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{"{", " ", 
     RowBox[{"foo", ",", " ", "1", ",", " ", "10"}], " ", "}"}]}], 
   "]"}]}]}], "Input",
 CellChangeTimes->{{3.504016424813343*^9, 3.504016580297758*^9}, {
   3.504018269599441*^9, 3.504018279219314*^9}, {3.504018359153508*^9, 
   3.504018387475568*^9}, {3.5040184327040863`*^9, 3.504018509500141*^9}, {
   3.504018861653284*^9, 3.504018920277594*^9}, {3.504019049785894*^9, 
   3.504019065803638*^9}, 3.504019184180941*^9, {3.504059801963703*^9, 
   3.504059813764331*^9}, 3.5040599982883453`*^9, {3.504060100407703*^9, 
   3.504060104803857*^9}, 3.504060440796597*^9, {3.504060503267675*^9, 
   3.504060525182757*^9}, {3.50456047953319*^9, 3.504560681387557*^9}, {
   3.504577463729417*^9, 3.504577464011519*^9}, {3.504577589051256*^9, 
   3.504577590132493*^9}, {3.504577632742776*^9, 3.5045776330605373`*^9}, {
   3.504740502012248*^9, 3.504740503922497*^9}, {3.504740727150861*^9, 
   3.504740736352736*^9}, 3.504876469621917*^9, {3.5055962008030443`*^9, 
   3.505596275077857*^9}, {3.505596319880871*^9, 3.505596373226162*^9}, {
   3.505596415459552*^9, 3.505596505766666*^9}, {3.50559654044011*^9, 
   3.505596540734797*^9}, 3.505672802683957*^9, 3.5056942774993753`*^9, {
   3.505694366620678*^9, 3.505694366726482*^9}, {3.5057600362594757`*^9, 
   3.5057600462592773`*^9}, 3.505760218072028*^9, {3.5057618784831467`*^9, 
   3.5057618855096197`*^9}, {3.505765314690784*^9, 3.505765460997046*^9}, {
   3.505765519815023*^9, 3.505765560295491*^9}, 3.505765708877458*^9, {
   3.5059422297177*^9, 3.50594224933794*^9}, {3.5059422915411587`*^9, 
   3.5059423868650618`*^9}, {3.505942419849204*^9, 3.505942458271961*^9}, 
   3.506003797955632*^9, 3.522544655482306*^9, 3.522544695510792*^9, {
   3.526412258232821*^9, 3.5264124297647047`*^9}, {3.526412534152213*^9, 
   3.526412549418888*^9}, {3.526412580963234*^9, 3.526412612442492*^9}, {
   3.52641284537436*^9, 3.526412862526091*^9}, {3.526412977275703*^9, 
   3.526412977409284*^9}, {3.5264130300128517`*^9, 3.526413071567891*^9}, {
   3.5264131895823917`*^9, 3.5264131965298567`*^9}, {3.5264133128542147`*^9, 
   3.526413315530311*^9}, {3.526413392188962*^9, 3.5264134345921392`*^9}, {
   3.526413727365831*^9, 3.526413730697576*^9}, {3.52641407631104*^9, 
   3.526414085568967*^9}, 3.526430667444561*^9, 3.52643074409554*^9, {
   3.526492438757979*^9, 3.526492455159773*^9}, 3.52649809101746*^9, 
   3.527038979383321*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindMaximum", "::", "\<\"precw\"\>"}], 
  RowBox[{
  ":", " "}], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"The precision of the \
argument function (\\\\\\\"\\\", \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(-\\(\\((\\(\\(1.\
4850910570449836` \[InvisibleSpace]\\)\\) + \
\\(\\(Log[\\(\\(0.5418547267178649`\\\\ \
\[ExponentialE]\\^\\(\\(\\(-0.9223921643984534`\\)\\)\\\\ \\(Plus[\\(\\(\
\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\^2\\)\\)\\)]\\)\\) + \\(\\(\
\[LeftSkeleton] 39 \[RightSkeleton]\\)\\) + \\(\\(0.4288626037441995`\\\\ \\(\
\\(Log[\\(\\(\[ExponentialE]\\^\\(13.822232334050717`\\\\ \\(\\(Power[\\(\\(\
\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\)\\)\\/\\(1 + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \
\[RightSkeleton]\\)\\)]\\)\\)\\)\\)\\)]\\)\\)\\)\\))\\)\\)\\), \\\"MT\\\"]\\)\
\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\") is less than WorkingPrecision (\\\\\
\\\"\\\", \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(20.`\\), \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\").\\\\\\\"\\\", \
\\\"MT\\\"]\\) \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/precw\\\", ButtonNote -> \
\\\"FindMaximum::precw\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{{3.526492456759232*^9, 3.526492503457635*^9}, 
   3.5264980914682083`*^9, 3.527038983908208*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindMaximum", "::", "\<\"precw\"\>"}], 
  RowBox[{
  ":", " "}], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"The precision of the \
argument function (\\\\\\\"\\\", \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(-\\(\\((\\(\\(1.\
1091954253604857` \[InvisibleSpace]\\)\\) + \
\\(\\(Log[\\(\\(1.3054689810635642`\\\\ \
\[ExponentialE]\\^\\(\\(\\(-5.354056956732767`\\)\\)\\\\ \\(Plus[\\(\\(\
\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\^2\\)\\)\\)]\\)\\) + \\(\\(\
\[LeftSkeleton] 39 \[RightSkeleton]\\)\\) + \\(\\(0.06330053769692141`\\\\ \
\\(\\(Log[\\(\\(\[ExponentialE]\\^\\(18.290244212140223`\\\\ \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\)\\)\\/\\(1 + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \
\[RightSkeleton]\\)\\)]\\)\\)\\)\\)\\)]\\)\\)\\)\\))\\)\\)\\), \\\"MT\\\"]\\)\
\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\") is less than WorkingPrecision (\\\\\
\\\"\\\", \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(20.`\\), \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\").\\\\\\\"\\\", \
\\\"MT\\\"]\\) \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/precw\\\", ButtonNote -> \
\\\"FindMaximum::precw\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{{3.526492456759232*^9, 3.526492503457635*^9}, 
   3.5264980914682083`*^9, 3.527038984010333*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindMaximum", "::", "\<\"precw\"\>"}], 
  RowBox[{
  ":", " "}], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"The precision of the \
argument function (\\\\\\\"\\\", \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(-\\(\\((\\(\\(1.\
1441741017806712` \[InvisibleSpace]\\)\\) + \
\\(\\(Log[\\(\\(6.902659721261067`\\\\ \
\[ExponentialE]\\^\\(\\(\\(-149.68655796009085`\\)\\)\\\\ \\(Plus[\\(\\(\
\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\^2\\)\\)\\)]\\)\\) + \\(\\(\
\[LeftSkeleton] 39 \[RightSkeleton]\\)\\) + \\(\\(0.6958104331832721`\\\\ \\(\
\\(Log[\\(\\(\[ExponentialE]\\^\\(14.15161351000132`\\\\ \\(\\(Power[\\(\\(\
\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\)\\)\\/\\(1 + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \
\[RightSkeleton]\\)\\)]\\)\\)\\)\\)\\)]\\)\\)\\)\\))\\)\\)\\), \\\"MT\\\"]\\)\
\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\") is less than WorkingPrecision (\\\\\
\\\"\\\", \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(20.`\\), \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\").\\\\\\\"\\\", \
\\\"MT\\\"]\\) \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/precw\\\", ButtonNote -> \
\\\"FindMaximum::precw\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{{3.526492456759232*^9, 3.526492503457635*^9}, 
   3.5264980914682083`*^9, 3.527038984105517*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"General", "::", "\<\"stop\"\>"}], 
  RowBox[{
  ":", " "}], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"Further output of \\\\\\\"\\\
\", \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(FindMaximum :: \
\\\"precw\\\"\\), \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\" will \
be suppressed during this calculation.\\\\\\\"\\\", \\\"MT\\\"]\\) \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/stop\\\", \
ButtonNote -> \\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{{3.526492456759232*^9, 3.526492503457635*^9}, 
   3.5264980914682083`*^9, 3.5270389841291847`*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.4052517273146944`", ",", "0.9456002551086214`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.731810050634164`", ",", "0.7501418419472496`", ",", 
         "0.7453277106442027`", ",", "0.5674530434498114`", ",", 
         "0.5748571393696454`", ",", "0.5023762911334945`", ",", 
         "0.7556612101030097`", ",", "0.5334633309696182`", ",", 
         "0.03177349644866846`", ",", "0.6627797461152791`", ",", 
         "0.43191407414089694`", ",", "0.8904412143059617`", ",", 
         "0.3516588068872681`", ",", "0.5117971260058639`", ",", 
         "0.859540102857841`", ",", "0.2305139470985558`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.963731900844579`", ",", "0.297181796338349`", ",", 
         "0.2654081614380332`", ",", "0.4405423250955594`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.16067265437836356`", ",", "0.48639504918217624`", ",", 
         "0.8601564341233389`", ",", "0.494942069986938`", ",", 
         "0.4288626037441995`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}]}], "}"}], ",", 
       "0.7362532072349266`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "36.34118881211016853040788916130281452487`20."}], ",", 
       RowBox[{
       "-", "1.7037836474824718487797002773018762620293770244928044377275`20.\
"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.11482872347913611`", ",", "0.9274890265371266`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.854005464374554`", ",", "0.23387691610143216`", ",", 
         "0.3591675133761264`", ",", "0.39402569556750844`", ",", 
         "0.8222319679258856`", ",", "0.571097169986153`", ",", 
         "0.9272534392352295`", ",", "0.5035844812615468`", ",", 
         "0.47057316103861757`", ",", "0.05930004398028911`", ",", 
         "0.06771333637738847`", ",", "0.273070534162991`", ",", 
         "0.5068412601940385`", ",", "0.76211824764194`", ",", 
         "0.8023051749393553`", ",", "0.8325282090674315`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.346168605815675`", ",", "0.2757231984597638`", ",", 
         "0.9421487408160164`", ",", "0.33758613908049356`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9173060020714755`", ",", "0.5394699912248372`", ",", 
         "0.8273200173368803`", ",", "0.41009711254336695`", ",", 
         "0.06330053769692141`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.305593075123405`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "60.21368872862525107353946541197906513657`20."}], ",", 
       RowBox[{
       "-", "1.4850661886454523105964998311954250110803718619781332854757`20.\
"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.4681525039607539`", ",", "0.016071416975858472`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.2410685697710358`", ",", "0.7344959051372519`", ",", 
         "0.5408990647255244`", ",", "0.5124869357143117`", ",", 
         "0.7704954087324183`", ",", "0.6751958611569628`", ",", 
         "0.47318572834813594`", ",", "0.2394164015513207`", ",", 
         "0.2636541485383797`", ",", "0.9130776135150228`", ",", 
         "0.6708805534087807`", ",", "0.40688819248388913`", ",", 
         "0.9174855427227048`", ",", "0.637354415055259`", ",", 
         "0.7287318125927642`", ",", "0.0693020534033956`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.00017954065122927293`", ",", "0.09788442383042183`", ",", 
         "0.9014117952558839`", ",", "0.6592049408600287`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9368790029543078`", ",", "0.7922913487070168`", ",", 
         "0.43325929129512997`", ",", "0.6431335238841702`", ",", 
         "0.6958104331832721`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.05779544356976485`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "180.36304620840527412829685465290917711282`20."}], ",", 
       "0.034721291249970015721101639213012340584807663770861019259`20."}], 
      "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.8923602265696056`", ",", "0.1306465881698585`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9253150244508538`", ",", "0.38259958241280195`", ",", 
         "0.41917449822146957`", ",", "0.8912301866185378`", ",", 
         "0.661660875912474`", ",", "0.4695219688977792`", ",", 
         "0.748293944812689`", ",", "0.4843419941346487`", ",", 
         "0.7441753331897693`", ",", "0.8321675538425202`", ",", 
         "0.0195621322199247`", ",", "0.41503994073125305`", ",", 
         "0.74399579253854`", ",", "0.7342831300120983`", ",", 
         "0.11815033696404083`", ",", "0.7558349998712244`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.8071167895842322`", ",", "0.9419917813050815`", ",", 
         "0.6848910456689109`", ",", "0.1127014759870542`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.11130635640096012`", ",", "0.8841963377353167`", ",", 
         "0.7925308190993053`", ",", "0.9820548878171957`", ",", 
         "0.18599133195010634`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}]}], "}"}], ",", 
       "0.5015967553225147`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "53.36356650766511323187805993016367566207`20."}], ",", 
       RowBox[{
       "-", "1.4447334394755153844351338204381419462808043780235878195128`20.\
"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.37335632087783577`", ",", "0.09082470119865789`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5243304560376323`", ",", "0.03207478642473553`", ",", 
         "0.6250623760651468`", ",", "0.6064827070640092`", ",", 
         "0.7801551228478629`", ",", "0.19990723258221535`", ",", 
         "0.6055002438452222`", ",", "0.19144276633275617`", ",", 
         "0.03615933030932293`", ",", "0.465624102570117`", ",", 
         "0.4873499068811813`", ",", "0.43560776646153176`", ",", 
         "0.22904254072509075`", ",", "0.5236323212650354`", ",", 
         "0.8024588612122704`", ",", "0.32290629047447755`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.11773618432413063`", ",", "0.6394359835297188`", ",", 
         "0.009928042112965106`", ",", "0.34085140265728187`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9317448523740243`", ",", "0.13783922820720407`", ",", 
         "0.6365717212351294`", ",", "0.250026701458624`", ",", 
         "0.40741439633639204`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}]}], "}"}], ",", 
       "0.10576444178246854`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "77.56445819038389859573466400179662314276`20."}], ",", 
       RowBox[{
       "-", "0.1729596905931475920521541108905615654963588458115086865519`20.\
"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.011509345169982515`", ",", "0.6435439943946147`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6272592734885291`", ",", "0.9058572092002531`", ",", 
         "0.40600910132476037`", ",", "0.4521012280618586`", ",", 
         "0.5910999431792061`", ",", "0.4402331066301362`", ",", 
         "0.918659194443579`", ",", "0.016493461600326824`", ",", 
         "0.3620574024541154`", ",", "0.9166007853651008`", ",", 
         "0.11620033323130861`", ",", "0.6935871711258492`", ",", 
         "0.24432121812998475`", ",", "0.277164801835382`", ",", 
         "0.1062722911183435`", ",", "0.3527357684685674`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.31257636575596043`", ",", "0.1393255736281779`", ",", 
         "0.4697005698832142`", ",", "0.10270906700994341`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.9051619694195684`", ",", "0.03356113184570937`", ",", 
         "0.45819122471323165`", ",", "0.45916507261532863`", ",", 
         "0.27790269593103933`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}]}], "}"}], ",", 
       "0.12770392264545619`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "45.97136567047013866124811732627539610345`20."}], ",", 
       RowBox[{
       "-", "0.3969570851628635364049957917208716562093627575752430303169`20.\
"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.052182123388471266`", ",", "0.00706384455347006`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6868027527518331`", ",", "0.68747081601532`", ",", 
         "0.1335229289448922`", ",", "0.9905703829531433`", ",", 
         "0.3247453502977178`", ",", "0.7708700306502192`", ",", 
         "0.01732259571358359`", ",", "0.296983211827294`", ",", 
         "0.080424132167733`", ",", "0.4937052288148372`", ",", 
         "0.9110503045952401`", ",", "0.9442474433587266`", ",", 
         "0.7678477664117725`", ",", "0.3543796551866593`", ",", 
         "0.44134973471202593`", ",", "0.8415383763487831`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.8626857969922042`", ",", "0.3208185233409499`", ",", 
         "0.9831585099987943`", ",", "0.3823733037334545`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5847831010611648`", ",", "0.19311460069549374`", ",", 
         "0.930976386610323`", ",", "0.3753094591799845`", ",", 
         "0.8979803483093317`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}]}], "}"}], ",", 
       "0.5056437846801738`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "48.94322076011297414901026774896375709864`20."}], ",", 
       RowBox[{
       "-", "1.879043053246696938158359851773385564618207288489770689921`20."}\
]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.7974534576654309`", ",", "0.3847390762268412`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5732349980116139`", ",", "0.7347737540299546`", ",", 
         "0.7801308619518472`", ",", "0.08775586439954726`", ",", 
         "0.4928108658438809`", ",", "0.24106852521511737`", ",", 
         "0.8690805573566072`", ",", "0.14350842104082068`", ",", 
         "0.7249630994321083`", ",", "0.8866888700284581`", ",", 
         "0.42773082264458123`", ",", "0.3019700446920375`", ",", 
         "0.8622773024399042`", ",", "0.5658703466875081`", ",", 
         "0.44457231264578695`", ",", "0.9195967409585829`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.27749420137873937`", ",", "0.3727557459920144`", ",", 
         "0.5135959260354639`", ",", "0.5442872817785985`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.3795138530694077`", ",", "0.8671119613118407`", ",", 
         "0.7161424683700331`", ",", "0.15954820555175725`", ",", 
         "0.8062788550577938`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.13233820728188603`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "118.79300571825089910431967054261709470641`20."}], ",", 
       RowBox[{
       "-", "0.2965587897930896084829229733650289525456744677001097443281`20.\
"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.9360116064181859`", ",", "0.07179234115220999`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.31346798921391295`", ",", "0.8912696820667686`", ",", 
         "0.06693104906157875`", ",", "0.9282839201113893`", ",", 
         "0.5885048897818046`", ",", "0.00458081203831057`", ",", 
         "0.6392002264169976`", ",", "0.6263138754193518`", ",", 
         "0.7262275873419004`", ",", "0.43871046535080244`", ",", 
         "0.1946279137712106`", ",", "0.7067171344607689`", ",", 
         "0.44873338596316104`", ",", "0.06595471935878801`", ",", 
         "0.6810319877357467`", ",", "0.16242985268217042`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.06921953289375335`", ",", "0.1988427580469474`", ",", 
         "0.9648895193657135`", ",", "0.0028816471304131622`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.26294067783595954`", ",", "0.06650455076506137`", ",", 
         "0.028877912947527704`", ",", "0.9310893059782032`", ",", 
         "0.9494726886220466`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ",", 
       "0.17523486869829272`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "89.00566849457226781074952434353249791598`20."}], ",", 
       RowBox[{
       "-", "0.386174498593627872340785184637496768589315365716174710542`20."}\
]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.961946863885949`", ",", "0.002805385866813843`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.360967798840242`", ",", "0.17065405665998215`", ",", 
         "0.32274663746895144`", ",", "0.376491510447462`", ",", 
         "0.6347402114983416`", ",", "0.7319435913091797`", ",", 
         "0.12811872369774083`", ",", "0.6697743759866931`", ",", 
         "0.18600682553518053`", ",", "0.6659888719503917`", ",", 
         "0.4470867359619941`", ",", "0.5073445233045227`", ",", 
         "0.11678729264142719`", ",", "0.46714611390344435`", ",", 
         "0.4821972165962805`", ",", "0.5044628761741096`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.8538466148054676`", ",", "0.40064156313838295`", ",", 
         "0.45331930364875284`", ",", "0.5733735701959064`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.904373926183421`", ",", "0.22540669444009023`", ",", 
         "0.49137243976280387`", ",", "0.5705681843290925`", ",", 
         "0.5434061273431791`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "1"}], "}"}]}], "}"}], ",", 
       "0.05475263778010806`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "236.37571494163540496216253058319482150615`20."}], ",", 
       "0.4287709194391488551932760591191002956523714573222605395131`20."}], 
      "}"}]}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{{3.526492456857325*^9, 3.526492503498892*^9}, 
   3.526498092225068*^9, 3.527038984749168*^9}]
}, Open  ]]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell["EMstep (log\[Alpha] and q)", "Subsection",
 CellChangeTimes->{{3.525095319326301*^9, 3.525095320059371*^9}, {
  3.52509801721535*^9, 3.525098017925005*^9}, {3.525112791223256*^9, 
  3.525112791828678*^9}, {3.525115293972691*^9, 3.525115296179682*^9}, {
  3.5251184948850317`*^9, 3.5251184992621593`*^9}, {3.526500226633251*^9, 
  3.526500228325598*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "emsteponce", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"emsteponce", "[", 
    RowBox[{
    "\[Kappa]_", ",", " ", "log\[Alpha]_", ",", " ", "\[Tau]_", ",", " ", 
     "log\[Lambda]_", ",", " ", "logpriorz_", ",", " ", "clamp_", ",", " ", 
     "d_", ",", " ", "plog\[Alpha]_"}], "]"}], " ", ":=", " ", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"q", ",", " ", "pznew", ",", " ", "log\[Alpha]new"}], "}"}], 
     ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"pznew", " ", "=", " ", 
       RowBox[{"estep", "[", 
        RowBox[{
        "logpriorz", ",", " ", "d", ",", " ", "log\[Alpha]", ",", " ", 
         "log\[Lambda]", ",", " ", "\[Tau]", ",", " ", "clamp"}], "]"}]}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"{", " ", 
        RowBox[{"q", ",", " ", "log\[Alpha]new"}], " ", "}"}], " ", "=", " ", 
       
       RowBox[{"mstep", "[", 
        RowBox[{
        "\[Kappa]", ",", " ", "log\[Alpha]", ",", " ", "\[Tau]", ",", " ", 
         "log\[Lambda]", ",", " ", "pznew", ",", "d", ",", " ", 
         "plog\[Alpha]"}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"{", " ", 
       RowBox[{"q", ",", " ", "pznew", ",", " ", "log\[Alpha]new"}], " ", 
       "}"}]}]}], "\[IndentingNewLine]", "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "emstepf", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"emstepf", "[", "tuple_", "]"}], " ", ":=", " ", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "q", ",", " ", "\[Kappa]", ",", " ", "log\[Alpha]", ",", " ", "\[Tau]", 
       ",", " ", "log\[Lambda]", ",", " ", "pz", ",", "logpriorz", ",", " ", 
       "clamp", ",", " ", "d", ",", " ", "plog\[Alpha]", ",", " ", "qnew", 
       ",", " ", "pznew", ",", " ", "log\[Alpha]new"}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"{", " ", 
        RowBox[{
        "q", ",", " ", "\[Kappa]", ",", " ", "log\[Alpha]", ",", " ", 
         "\[Tau]", ",", " ", "log\[Lambda]", ",", " ", "pz", ",", "logpriorz",
          ",", " ", "clamp", ",", " ", "d", ",", " ", "plog\[Alpha]"}], " ", 
        "}"}], " ", "=", " ", "tuple"}], ";", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"{", " ", 
        RowBox[{"qnew", ",", " ", "pznew", ",", " ", "log\[Alpha]new"}], " ", 
        "}"}], " ", "=", " ", 
       RowBox[{"emsteponce", "[", 
        RowBox[{
        "\[Kappa]", ",", " ", "log\[Alpha]", ",", " ", "\[Tau]", ",", " ", 
         "log\[Lambda]", ",", " ", "logpriorz", ",", " ", "clamp", ",", " ", 
         "d", ",", " ", "plog\[Alpha]"}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"{", " ", 
       RowBox[{
       "qnew", ",", "\[Kappa]", ",", " ", "log\[Alpha]new", ",", " ", 
        "\[Tau]", ",", " ", "log\[Lambda]", ",", " ", "pznew", ",", 
        "logpriorz", ",", " ", "clamp", ",", " ", "d", ",", " ", 
        "plog\[Alpha]"}], " ", "}"}]}]}], " ", "\[IndentingNewLine]", "]"}]}],
   ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "emstep", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"emstep", "[", 
   RowBox[{
   "tol_", ",", " ", "\[Kappa]_", ",", " ", "log\[Alpha]_", ",", " ", 
    "\[Tau]_", ",", " ", "log\[Lambda]_", ",", " ", "priorz_", ",", " ", 
    "clamp_", ",", " ", "d_", ",", " ", "plog\[Alpha]_"}], "]"}], ":=", " ", 
  RowBox[{
   RowBox[{"FixedPoint", "[", 
    RowBox[{"emstepf", ",", " ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "100"}], ",", "  ", "\[Kappa]", ",", " ", "log\[Alpha]", 
       ",", " ", "\[Tau]", ",", " ", "log\[Lambda]", ",", " ", "priorz", ",", 
       
       RowBox[{"Log", "[", "priorz", "]"}], ",", " ", "clamp", ",", " ", "d", 
       ",", " ", "plog\[Alpha]"}], "}"}], ",", 
     RowBox[{"SameTest", "\[Rule]", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{
         RowBox[{"Abs", "[", 
          RowBox[{
           RowBox[{"#1", "[", 
            RowBox[{"[", "1", "]"}], "]"}], " ", "-", " ", 
           RowBox[{"#2", "[", 
            RowBox[{"[", "1", "]"}], "]"}]}], "]"}], " ", "<", " ", 
         RowBox[{"tol", " ", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"Abs", "[", 
             RowBox[{"#1", "[", 
              RowBox[{"[", "1", "]"}], "]"}], "]"}], " ", "+", " ", 
            RowBox[{"Abs", "[", 
             RowBox[{"#2", "[", 
              RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ")"}]}]}], "&"}], 
       ")"}]}]}], "]"}], " ", "//", " ", 
   RowBox[{
    RowBox[{"{", " ", 
     RowBox[{
      RowBox[{"#", "[", 
       RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
      RowBox[{"#", "[", 
       RowBox[{"[", "3", "]"}], "]"}], ",", " ", 
      RowBox[{"#", "[", 
       RowBox[{"[", "6", "]"}], "]"}]}], "}"}], "&"}]}]}]}], "Input",
 CellChangeTimes->{{3.525118502664279*^9, 3.5251189229771748`*^9}, {
   3.525118971729904*^9, 3.52511906365032*^9}, 3.525119216489663*^9, {
   3.52511927699596*^9, 3.525119385656954*^9}, {3.5251194234202023`*^9, 
   3.5251194314497128`*^9}, {3.525119463132557*^9, 3.525119463482739*^9}, {
   3.525119510764413*^9, 3.525119696006434*^9}, {3.52511973278708*^9, 
   3.5251198264569597`*^9}, {3.5251198791493273`*^9, 3.525119881275783*^9}, {
   3.525119955256009*^9, 3.525119993679954*^9}, {3.5265002695455008`*^9, 
   3.526500332941578*^9}, {3.526500369666182*^9, 3.52650042405199*^9}, {
   3.5265004724341307`*^9, 3.526500587699682*^9}, {3.526502847654395*^9, 
   3.526502954109222*^9}, {3.526503215230756*^9, 3.526503276460854*^9}, {
   3.526503308082038*^9, 3.5265033119789867`*^9}, 3.5265036313778563`*^9, {
   3.5265037073986053`*^9, 3.526503707695611*^9}, {3.526503973769458*^9, 
   3.526503977301149*^9}, {3.526504637767449*^9, 3.526504638421287*^9}, {
   3.527039060079911*^9, 3.5270390876971693`*^9}, {3.527039147677495*^9, 
   3.527039177669166*^9}, {3.527039212404153*^9, 3.52703921289738*^9}, {
   3.527039345254841*^9, 3.527039364458366*^9}}],

Cell[CellGroupData[{

Cell["Test Vectors for EMstep", "Subsubsection",
 CellChangeTimes->{{3.50401932583255*^9, 3.504019328703233*^9}, {
  3.504185890254962*^9, 3.504185890709035*^9}, {3.5042036574835863`*^9, 
  3.504203657569166*^9}, {3.504916768505199*^9, 3.504916769023423*^9}, {
  3.5264122361917953`*^9, 3.526412241984367*^9}, {3.526498353607053*^9, 
  3.526498354044754*^9}, {3.526503007240696*^9, 3.526503007498164*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "nworkers", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nworkers", " ", "=", " ", "4"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nlabels", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nlabels", " ", "=", " ", "5"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", "nratings", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nratings", " ", "=", " ", "8"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"#", "[", 
      RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
     RowBox[{"#", "[", 
      RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "&"}], " ", "/@", 
  "\[IndentingNewLine]", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{
     RowBox[{"{", " ", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"ListQ", "[", "#", "]"}], " ", "&&", " ", 
            RowBox[{"(", 
             RowBox[{
              RowBox[{"!", " ", 
               RowBox[{"ListQ", "[", 
                RowBox[{"#", "[", 
                 RowBox[{"[", "1", "]"}], "]"}], "]"}]}], " ", "||", " ", 
              RowBox[{"!", " ", 
               RowBox[{"IntegerQ", "[", 
                RowBox[{
                 RowBox[{"#", "[", 
                  RowBox[{"[", "1", "]"}], "]"}], "[", 
                 RowBox[{"[", "1", "]"}], "]"}], "]"}]}]}], ")"}]}], ",", " ", 
           RowBox[{"Flatten", "[", "#", "]"}], ",", " ", "#"}], "]"}], "&"}], 
        " ", "/@", " ", "#"}], ",", " ", "\[IndentingNewLine]", 
       RowBox[{"emstep", "[", "\[IndentingNewLine]", 
        RowBox[{"0.0001", ",", 
         RowBox[{"(*", " ", "tol", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "1", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "2", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"Table", "[", 
            RowBox[{
             RowBox[{"j", "  ", "-", " ", "0.5", " ", "+", " ", 
              RowBox[{
               RowBox[{
                RowBox[{"#", "[", 
                 RowBox[{"[", "3", "]"}], "]"}], "[", 
                RowBox[{"[", "k", "]"}], "]"}], "[", 
               RowBox[{"[", "j", "]"}], "]"}]}], ",", 
             RowBox[{"{", " ", 
              RowBox[{"j", ",", " ", "1", ",", " ", 
               RowBox[{"Length", "[", 
                RowBox[{
                 RowBox[{"#", "[", 
                  RowBox[{"[", "3", "]"}], "]"}], "[", 
                 RowBox[{"[", "k", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",",
            " ", 
           RowBox[{"{", " ", 
            RowBox[{"k", ",", " ", "1", ",", " ", 
             RowBox[{"Length", "[", 
              RowBox[{"#", "[", 
               RowBox[{"[", "3", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", 
         RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "4", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], 
         "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "5", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "priorz", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"#", "[", 
          RowBox[{"[", "6", "]"}], "]"}], ",", " ", 
         RowBox[{"(*", " ", "clamp", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{"1", "+", 
              RowBox[{"#", "[", 
               RowBox[{"[", "1", "]"}], "]"}]}], ",", 
             RowBox[{"#", "[", 
              RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "&"}], " ", "/@", " ", 
          
          RowBox[{"#", "[", 
           RowBox[{"[", "7", "]"}], "]"}]}], ",", " ", 
         RowBox[{"(*", " ", "d", " ", "*)"}], "\[IndentingNewLine]", 
         RowBox[{"Function", "[", 
          RowBox[{"x", ",", " ", 
           RowBox[{"NormalDistribution", "[", 
            RowBox[{"x", ",", " ", 
             RowBox[{"#", "[", 
              RowBox[{"[", "8", "]"}], "]"}]}], "]"}]}], "]"}]}], 
        RowBox[{"(*", " ", "plog\[Alpha]", " ", "*)"}], "\[IndentingNewLine]",
         "]"}]}], " ", "}"}], "&"}], " ", "/@", " ", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{"{", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"(*", " ", "\[Kappa]", " ", "*)"}], "\[IndentingNewLine]", 
        RowBox[{"Random", "[", "]"}], ",", " ", 
        RowBox[{"(*", " ", "log\[Alpha]", " ", "*)"}], "\[IndentingNewLine]", 
        
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Table", "[", 
           RowBox[{
            RowBox[{"Random", "[", "]"}], ",", 
            RowBox[{"{", " ", 
             RowBox[{"j", ",", " ", "1", ",", " ", 
              RowBox[{"nlabels", " ", "-", " ", "1"}]}], "}"}]}], "]"}], ",", 
          " ", 
          RowBox[{"{", " ", 
           RowBox[{"k", ",", " ", "1", ",", " ", "nworkers"}], "}"}]}], "]"}],
         ",", " ", 
        RowBox[{"(*", " ", "\[Tau]", " ", "*)"}], "\[IndentingNewLine]", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Random", "[", "]"}], ",", " ", 
          RowBox[{"{", " ", 
           RowBox[{"i", ",", " ", "1", ",", " ", "nworkers"}], " ", "}"}]}], 
         "]"}], ",", " ", 
        RowBox[{"(*", " ", "log\[Lambda]", " ", "*)"}], " ", 
        "\[IndentingNewLine]", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Random", "[", "]"}], ",", " ", 
          RowBox[{"{", 
           RowBox[{"i", ",", " ", "1", ",", " ", "nlabels"}], "}"}]}], "]"}], 
        ",", " ", 
        RowBox[{"(*", " ", "priorz", " ", "*)"}], "\[IndentingNewLine]", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"Random", "[", "]"}], " ", "<", " ", "0.5"}], ",", " ", 
          RowBox[{"-", "1"}], ",", " ", 
          RowBox[{"Random", "[", 
           RowBox[{"Integer", ",", " ", 
            RowBox[{"nlabels", " ", "-", " ", "1"}]}], "]"}]}], "]"}], ",", 
        " ", 
        RowBox[{"(*", " ", "clamp", " ", "*)"}], "\[IndentingNewLine]", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{
            RowBox[{"Random", "[", 
             RowBox[{"Integer", ",", " ", 
              RowBox[{"nworkers", " ", "-", " ", "1"}]}], "]"}], ",", 
            RowBox[{"Random", "[", 
             RowBox[{"Integer", ",", " ", 
              RowBox[{"nlabels", " ", "-", " ", "1"}]}], "]"}]}], "}"}], ",", 
          " ", 
          RowBox[{"{", " ", 
           RowBox[{"i", ",", " ", "1", ",", " ", "nratings"}], " ", "}"}]}], 
         "]"}], ",", 
        RowBox[{"(*", " ", "d", " ", "*)"}], "\[IndentingNewLine]", 
        RowBox[{"1", " ", "+", " ", 
         RowBox[{"Random", "[", "]"}]}]}], " ", 
       RowBox[{"(*", " ", 
        RowBox[{"plog\[Alpha]", " ", "stddev"}], " ", "*)"}], 
       "\[IndentingNewLine]", "}"}], ",", " ", 
      RowBox[{"{", " ", 
       RowBox[{"foo", ",", " ", "1", ",", " ", "6"}], " ", "}"}]}], "]"}]}], 
   ")"}]}]}], "Input",
 CellChangeTimes->{{3.504016424813343*^9, 3.504016580297758*^9}, {
   3.504018269599441*^9, 3.504018279219314*^9}, {3.504018359153508*^9, 
   3.504018387475568*^9}, {3.5040184327040863`*^9, 3.504018509500141*^9}, {
   3.504018861653284*^9, 3.504018920277594*^9}, {3.504019049785894*^9, 
   3.504019065803638*^9}, 3.504019184180941*^9, {3.504059801963703*^9, 
   3.504059813764331*^9}, 3.5040599982883453`*^9, {3.504060100407703*^9, 
   3.504060104803857*^9}, 3.504060440796597*^9, {3.504060503267675*^9, 
   3.504060525182757*^9}, {3.50418590618461*^9, 3.504185912579707*^9}, {
   3.504186397115213*^9, 3.5041864627493553`*^9}, {3.504187243434793*^9, 
   3.504187335384948*^9}, {3.5041877893781147`*^9, 3.504187789468603*^9}, {
   3.5042036666855288`*^9, 3.504203720287292*^9}, {3.504203761143361*^9, 
   3.5042038785987473`*^9}, 3.504204172101022*^9, {3.504204669966267*^9, 
   3.504204721532045*^9}, {3.504205201368525*^9, 3.50420520145702*^9}, {
   3.505589135463067*^9, 3.505589138197913*^9}, {3.505589410144479*^9, 
   3.505589470226988*^9}, {3.50558950031635*^9, 3.5055895318620234`*^9}, {
   3.505593036660348*^9, 3.5055930431613007`*^9}, 3.505593571277896*^9, {
   3.5055946005056257`*^9, 3.505594637819249*^9}, {3.505594708646364*^9, 
   3.5055947672213717`*^9}, 3.505594822362433*^9, 3.505694904993847*^9, 
   3.50569495400416*^9, {3.5057484466063337`*^9, 3.505748464550887*^9}, 
   3.505759963261848*^9, {3.50594173038643*^9, 3.505941756411881*^9}, 
   3.5059418679837847`*^9, {3.525989118603919*^9, 3.525989133588447*^9}, {
   3.525989176585618*^9, 3.525989329780985*^9}, {3.5259894579149*^9, 
   3.525989471950355*^9}, {3.525989581415557*^9, 3.525989585593624*^9}, {
   3.525992245973118*^9, 3.52599228203554*^9}, 3.5259939716950493`*^9, {
   3.526503028823398*^9, 3.526503036946804*^9}, {3.526503068108279*^9, 
   3.52650315070844*^9}, {3.5265033410692577`*^9, 3.526503451923143*^9}, {
   3.526503491890305*^9, 3.5265035208767567`*^9}, {3.526503821918139*^9, 
   3.526503822799163*^9}, {3.5265038549278803`*^9, 3.526503899410151*^9}, {
   3.526503945007889*^9, 3.526503965852463*^9}, {3.5265042709504747`*^9, 
   3.526504271091518*^9}, {3.526504423145095*^9, 3.526504425171175*^9}, {
   3.526504651329237*^9, 3.526504665143652*^9}, 3.526504749223894*^9, {
   3.5270392330240583`*^9, 3.527039262448041*^9}, {3.527039507778572*^9, 
   3.5270395079380283`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindMaximum", "::", "\<\"precw\"\>"}], 
  RowBox[{
  ":", " "}], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"The precision of the \
argument function (\\\\\\\"\\\", \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(-\\(\\((\\(\\(0.\
005288809181274723` \[InvisibleSpace]\\)\\) + \\(\\(\[LeftSkeleton] 35 \
\[RightSkeleton]\\)\\) + \\(\\(1.5405465423473126`*^-18\\\\ \\(\\(Log[\\(\\(\
\[ExponentialE]\\^\\(10.762753189189418`\\\\ \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\)\\)\\/\\(1 + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \
\[RightSkeleton]\\)\\)]\\)\\)\\)\\)\\)]\\)\\)\\)\\))\\)\\)\\), \\\"MT\\\"]\\)\
\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\") is less than WorkingPrecision (\\\\\
\\\"\\\", \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(20.`\\), \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\").\\\\\\\"\\\", \
\\\"MT\\\"]\\) \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/precw\\\", ButtonNote -> \
\\\"FindMaximum::precw\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.526503900273711*^9, {3.5265039664914703`*^9, 3.526503979163772*^9}, 
   3.526504272558733*^9, 3.5265044273872757`*^9, {3.526504641904673*^9, 
   3.5265046757745113`*^9}, 3.5265047498122168`*^9, {3.527039235044092*^9, 
   3.527039262768598*^9}, 3.5270393741548147`*^9, 3.527039508322145*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindMaximum", "::", "\<\"precw\"\>"}], 
  RowBox[{
  ":", " "}], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"The precision of the \
argument function (\\\\\\\"\\\", \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(-\\(\\((\\(\\(0.\
5542667981653664` \[InvisibleSpace]\\)\\) + \\(\\(\[LeftSkeleton] 35 \
\[RightSkeleton]\\)\\) + \\(\\(3.098791298171907`*^-6\\\\ \\(\\(Log[\\(\\(\
\[ExponentialE]\\^\\(10.762753189189418`\\\\ \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\)\\)\\/\\(1 + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \
\[RightSkeleton]\\)\\)]\\)\\)\\)\\)\\)]\\)\\)\\)\\))\\)\\)\\), \\\"MT\\\"]\\)\
\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\") is less than WorkingPrecision (\\\\\
\\\"\\\", \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(20.`\\), \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\").\\\\\\\"\\\", \
\\\"MT\\\"]\\) \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/precw\\\", ButtonNote -> \
\\\"FindMaximum::precw\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.526503900273711*^9, {3.5265039664914703`*^9, 3.526503979163772*^9}, 
   3.526504272558733*^9, 3.5265044273872757`*^9, {3.526504641904673*^9, 
   3.5265046757745113`*^9}, 3.5265047498122168`*^9, {3.527039235044092*^9, 
   3.527039262768598*^9}, 3.5270393741548147`*^9, 3.5270395084115467`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"FindMaximum", "::", "\<\"precw\"\>"}], 
  RowBox[{
  ":", " "}], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"The precision of the \
argument function (\\\\\\\"\\\", \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(-\\(\\((\\(\\(0.\
7152233111300523` \[InvisibleSpace]\\)\\) + \\(\\(\[LeftSkeleton] 35 \
\[RightSkeleton]\\)\\) + \\(\\(0.000029412742709720645`\\\\ \\(\\(Log[\\(\\(\
\[ExponentialE]\\^\\(10.762753189189418`\\\\ \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\)\\)\\/\\(1 + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\)]\\)\\) + \
\\(\\(Power[\\(\\(\[LeftSkeleton] 2 \
\[RightSkeleton]\\)\\)]\\)\\)\\)\\)\\)]\\)\\)\\)\\))\\)\\)\\), \\\"MT\\\"]\\)\
\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\") is less than WorkingPrecision (\\\\\
\\\"\\\", \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(20.`\\), \
\\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\").\\\\\\\"\\\", \
\\\"MT\\\"]\\) \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/precw\\\", ButtonNote -> \
\\\"FindMaximum::precw\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.526503900273711*^9, {3.5265039664914703`*^9, 3.526503979163772*^9}, 
   3.526504272558733*^9, 3.5265044273872757`*^9, {3.526504641904673*^9, 
   3.5265046757745113`*^9}, 3.5265047498122168`*^9, {3.527039235044092*^9, 
   3.527039262768598*^9}, 3.5270393741548147`*^9, 3.527039508550877*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"General", "::", "\<\"stop\"\>"}], 
  RowBox[{
  ":", " "}], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"Further output of \\\\\\\"\\\
\", \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\!\\(FindMaximum :: \
\\\"precw\\\"\\), \\\"MT\\\"]\\)\[NoBreak]\\!\\(\\*StyleBox[\\\"\\\\\\\" will \
be suppressed during this calculation.\\\\\\\"\\\", \\\"MT\\\"]\\) \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/stop\\\", \
ButtonNote -> \\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.526503900273711*^9, {3.5265039664914703`*^9, 3.526503979163772*^9}, 
   3.526504272558733*^9, 3.5265044273872757`*^9, {3.526504641904673*^9, 
   3.5265046757745113`*^9}, 3.5265047498122168`*^9, {3.527039235044092*^9, 
   3.527039262768598*^9}, 3.5270393741548147`*^9, 3.527039508572822*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.9238114028376916`", ",", "0.4984075656619062`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.011268244611301138`", ",", "0.6348884521319681`", ",", 
         "0.46096066913451`", ",", "0.11067596756427106`", ",", 
         "0.4677524979635976`", ",", "0.9479493896043519`", ",", 
         "0.8212272108924457`", ",", "0.14507378588569989`", ",", 
         "0.25731596979468235`", ",", "0.8620824325339782`", ",", 
         "0.1612889263061966`", ",", "0.28166339225918113`", ",", 
         "0.5172152285835041`", ",", "0.08159734548149157`", ",", 
         "0.9693502181428078`", ",", "0.6347659637821788`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6982767171640586`", ",", "0.2835163117016852`", ",", 
         "0.22676748747285116`", ",", "0.7435434491381476`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.8937325136668189`", ",", "0.6557408070984144`", ",", 
         "0.30295608463515955`", ",", "0.2451358834762414`", ",", 
         "0.8824642690555179`"}], "}"}], ",", 
       RowBox[{"-", "1"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}]}], "}"}], ",", 
       "1.8419954155006495`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "12.66929491274222815906153235468858393936`20."}], ",", 
       RowBox[{
       "-", "1.0697869669947522033652169639944696954901039536872772176752`20.\
"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.016386076316907486`", ",", "0.43242819882089273`", ",", 
         "0.513333639870126`", ",", "0.03745041012222182`", ",", 
         "0.0004016748698520394`"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.13445991591197035`", ",", "0.41471177109192026`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.07290296536209444`", ",", "0.020768204608203812`", ",", 
         "0.9893861300262704`", ",", "0.1573958012972379`", ",", 
         "0.21082053282811622`", ",", "0.8594792783020072`", ",", 
         "0.7077227377670893`", ",", "0.6401805727137339`", ",", 
         "0.12922318734662466`", ",", "0.8901290601591995`", ",", 
         "0.07295677398491052`", ",", "0.9419038555496752`", ",", 
         "0.8457068756449395`", ",", "0.6633615726863483`", ",", 
         "0.3294133248467629`", ",", "0.04817134188285619`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.18996606854652504`", ",", "0.36040548805118877`", ",", 
         "0.0842774413705215`", ",", "0.16570707282733835`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.1691137135800787`", ",", "0.5184100725505393`", ",", 
         "0.9498175254585511`", ",", "0.7509953017354181`", ",", 
         "0.09621074821798428`"}], "}"}], ",", 
       RowBox[{"-", "1"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}]}], "}"}], ",", 
       "1.9604313954322807`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "13.94430652105266889535641384971656926542`20."}], ",", 
       RowBox[{
       "-", "1.7458488915506438603018984546390095622602978265199235691404`20.\
"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.017738814663274063`", ",", "0.1535463651566401`", ",", 
         "0.4646161959762519`", ",", "0.3412035850601171`", ",", 
         "0.022895039143716697`"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.5935995004381802`", ",", "0.8853902153898681`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6381625896403282`", ",", "0.2527086576651914`", ",", 
         "0.9534189277244464`", ",", "0.7561670280432434`", ",", 
         "0.7480335294811288`", ",", "0.1797518836802809`", ",", 
         "0.011515072174771176`", ",", "0.9104601523983039`", ",", 
         "0.08467195679478047`", ",", "0.8503385588335179`", ",", 
         "0.963343730291915`", ",", "0.7204940838517788`", ",", 
         "0.7242664687435917`", ",", "0.7660611174629965`", ",", 
         "0.7976366574645767`", ",", "0.5513803702717002`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.20585639619305246`", ",", "0.8162435920044453`", ",", 
         "0.04664135572915856`", ",", "0.45516962205371586`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7082145282507171`", ",", "0.8558121965721647`", ",", 
         "0.4530418552909784`", ",", "0.5697794066638479`", ",", 
         "0.07005193861038883`"}], "}"}], ",", "1", ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "2"}], "}"}]}], "}"}], ",", 
       "1.499622927566532`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "15.66205028341231964159352514258828930264`20."}], ",", 
       RowBox[{
       "-", "1.8205865261973466137137098434752219233026973681378169302576`20.\
"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "8.391073550217405`*^-7", ",", "0.9999924284941304`", ",", 
         "3.644572758496813`*^-6", ",", "2.381572038129453`*^-6", ",", 
         "7.062537181202864`*^-7"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.8136123786206044`", ",", "0.32201840912926005`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.4233516552266924`", ",", "0.4881078553917608`", ",", 
         "0.9031522262223005`", ",", "0.2373464523344796`", ",", 
         "0.5730130963931743`", ",", "0.5247641250998458`", ",", 
         "0.18265814237052166`", ",", "0.5130799835908879`", ",", 
         "0.8069519789301779`", ",", "0.7271274676352693`", ",", 
         "0.6312777720988215`", ",", "0.3072235873978354`", ",", 
         "0.9907083869257326`", ",", "0.6804861119061106`", ",", 
         "0.17610815004510566`", ",", "0.5990090591471183`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.1348961903535679`", ",", "0.22744425661513226`", ",", 
         "0.6063287433812579`", ",", "0.5289571205367295`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.5317926514465947`", ",", "0.7278213290486002`", ",", 
         "0.7927163647606534`", ",", "0.20693871140746947`", ",", 
         "0.10844099621990229`"}], "}"}], ",", 
       RowBox[{"-", "1"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "3"}], "}"}]}], "}"}], ",", 
       "1.8895641385383528`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "15.19521843369946757403547634073418555398`20."}], ",", 
       RowBox[{
       "-", "2.4304252378035908298245851616068986172331074179771479966762`20.\
"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.11495536738816979`", ",", "0.28617566044798104`", ",", 
         "0.43246347424199805`", ",", "0.11789192717217123`", ",", 
         "0.04851357074967994`"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.9695922590729898`", ",", "0.5354278998267279`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.7149493485569935`", ",", "0.7069059961678312`", ",", 
         "0.456512275482102`", ",", "0.72847592089655`", ",", 
         "0.9878218809217243`", ",", "0.07562822406900971`", ",", 
         "0.14928868808426662`", ",", "0.7377675339708175`", ",", 
         "0.30733576901561366`", ",", "0.8995200740239041`", ",", 
         "0.5502796289371482`", ",", "0.6028713436172496`", ",", 
         "0.07989151240048138`", ",", "0.2931913306426462`", ",", 
         "0.02132250840041874`", ",", "0.0710786921706549`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.3520701833518811`", ",", "0.5004749658819928`", ",", 
         "0.8143837969929493`", ",", "0.9626376959507527`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.11235670969504175`", ",", "0.6109108273436399`", ",", 
         "0.8447915379199594`", ",", "0.4272097961240247`", ",", 
         "0.3974073611380482`"}], "}"}], ",", "1", ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"2", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"3", ",", "0"}], "}"}]}], "}"}], ",", 
       "1.3882792624378575`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "16.68142450374858104191139642580049289717`20."}], ",", 
       RowBox[{
       "-", "1.8846996896412207069283008276149704846572012770972786717993`20.\
"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "4.4776521534934254`*^-7", ",", "0.9999910611249238`", ",", 
         "4.935078670266101`*^-6", ",", "2.9813898124743036`*^-6", ",", 
         "5.746413781700641`*^-7"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"0.6987338752274747`", ",", "0.4095854802163239`", ",", 
       RowBox[{"{", 
        RowBox[{
        "0.828376607106799`", ",", "0.23899057435359075`", ",", 
         "0.9609663412566573`", ",", "0.10224971120071027`", ",", 
         "0.9288565330828948`", ",", "0.6887109454164425`", ",", 
         "0.35809499763940766`", ",", "0.022358198800228893`", ",", 
         "0.6356652024402487`", ",", "0.6673884370160238`", ",", 
         "0.28701630546875273`", ",", "0.6702880154483477`", ",", 
         "0.1351902365582559`", ",", "0.8530046400230745`", ",", 
         "0.3243786095180001`", ",", "0.557931305753306`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.524279409214616`", ",", "0.00821310210311509`", ",", 
         "0.8971688133939754`", ",", "0.1605239446152578`"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.6202745780388074`", ",", "0.6199338396652577`", ",", 
         "0.1984349381665007`", ",", "0.7509384643989339`", ",", 
         "0.7918979709320084`"}], "}"}], ",", 
       RowBox[{"-", "1"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"0", ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "3"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"2", ",", "4"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}]}], "}"}], ",", 
       "1.2374685969098436`"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "16.0438874652797932776685730219938768518`20."}], ",", 
       RowBox[{
       "-", "1.8031552958438401693517137115117563347675838253480817495607`20.\
"}], ",", 
       RowBox[{"{", 
        RowBox[{
        "0.0031614611535752696`", ",", "0.04349379623505702`", ",", 
         "0.07597749684309457`", ",", "0.5303517853169502`", ",", 
         "0.3470154604513229`"}], "}"}]}], "}"}]}], "}"}]}], "}"}]], "Output",\

 CellChangeTimes->{
  3.5265036349970503`*^9, 3.526503710869643*^9, 3.5265037416310883`*^9, {
   3.526503861456119*^9, 3.5265039050898848`*^9}, {3.52650396657545*^9, 
   3.5265039793968687`*^9}, 3.526504272845715*^9, 3.526504429453422*^9, {
   3.526504642058465*^9, 3.526504676251309*^9}, 3.526504753563985*^9, {
   3.527039238833959*^9, 3.527039264140767*^9}, 3.5270393755741*^9, 
   3.52703951149218*^9}]
}, Open  ]]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell["\<\
sparse \[Gamma] and \[Tau] SGD approximation\
\>", "Subsection",
 CellChangeTimes->{{3.526761298196866*^9, 3.526761309724696*^9}, {
  3.526762070516046*^9, 3.526762080342836*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(", 
   RowBox[{
    RowBox[{"DSolve", "[", 
     RowBox[{
      RowBox[{"{", " ", 
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"\[Tau]", "'"}], "[", "t", "]"}], " ", "\[Equal]", " ", 
         RowBox[{"\[Eta]", " ", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{"\[Tau]0", " ", "+", " ", "t"}], ")"}], "^", 
           RowBox[{"(", 
            RowBox[{"-", "\[Chi]"}], ")"}]}], " ", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{"\[Gamma]", " ", "-", " ", 
             RowBox[{"\[Tau]", "[", "t", "]"}]}], ")"}], " ", "/", " ", 
           "\[Sigma]"}]}]}], ",", " ", 
        RowBox[{
         RowBox[{"\[Tau]", "[", "s", "]"}], " ", "\[Equal]", " ", 
         "\[Tau]s"}]}], " ", "}"}], ",", " ", 
      RowBox[{"\[Tau]", "[", "t", "]"}], ",", " ", "t"}], "]"}], " ", "//", 
    " ", "FullSimplify"}], ")"}], " ", "/.", " ", 
  RowBox[{"\[Tau]s", " ", "\[Rule]", " ", 
   RowBox[{"\[Tau]", "[", "s", "]"}]}]}]], "Input",
 CellChangeTimes->{{3.5267624523130074`*^9, 3.526762524716786*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"\[Tau]", "[", "t", "]"}], "\[Rule]", 
    RowBox[{"\[Gamma]", "+", 
     RowBox[{
      SuperscriptBox["\[ExponentialE]", 
       FractionBox[
        RowBox[{"\[Eta]", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", 
            SuperscriptBox[
             RowBox[{"(", 
              RowBox[{"s", "+", "\[Tau]0"}], ")"}], 
             RowBox[{"1", "-", "\[Chi]"}]]}], "+", 
           SuperscriptBox[
            RowBox[{"(", 
             RowBox[{"t", "+", "\[Tau]0"}], ")"}], 
            RowBox[{"1", "-", "\[Chi]"}]]}], ")"}]}], 
        RowBox[{"\[Sigma]", " ", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", "1"}], "+", "\[Chi]"}], ")"}]}]]], " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "\[Gamma]"}], "+", 
        RowBox[{"\[Tau]", "[", "s", "]"}]}], ")"}]}]}]}], "}"}], 
  "}"}]], "Output",
 CellChangeTimes->{{3.526762479439048*^9, 3.526762528098916*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Solve", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"(", 
      RowBox[{
       RowBox[{"D", "[", 
        RowBox[{
         RowBox[{
          RowBox[{"Log", "[", 
           RowBox[{"PDF", "[", 
            RowBox[{
             RowBox[{"NormalDistribution", "[", 
              RowBox[{"\[Mu]\[Gamma]", ",", " ", "\[Sigma]\[Gamma]"}], "]"}], 
             ",", " ", "\[Gamma]"}], "]"}], "]"}], " ", "+", " ", 
          RowBox[{"Sum", "[", 
           RowBox[{
            RowBox[{"Log", "[", 
             RowBox[{"PDF", "[", 
              RowBox[{
               RowBox[{"NormalDistribution", "[", 
                RowBox[{"\[Gamma]", ",", " ", "\[Sigma]\[Tau]"}], "]"}], ",", 
               " ", 
               RowBox[{"\[Tau]", "[", 
                RowBox[{"[", "i", "]"}], "]"}]}], "]"}], "]"}], ",", " ", 
            RowBox[{"{", " ", 
             RowBox[{"i", ",", " ", "1", ",", " ", "n"}], " ", "}"}]}], 
           "]"}]}], ",", " ", "\[Gamma]"}], "]"}], " ", "//", " ", 
       "FullSimplify"}], ")"}], " ", "\[Equal]", " ", "0"}], ",", " ", 
    "\[Gamma]"}], "]"}], " ", "//", " ", "Quiet"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"%", " ", "/.", " ", 
      RowBox[{"\[Mu]\[Gamma]", " ", "\[Rule]", " ", 
       RowBox[{"(", 
        RowBox[{"k", " ", "-", " ", 
         RowBox[{"1", "/", "2"}]}], ")"}]}]}], " ", "/.", " ", 
     RowBox[{"\[Sigma]\[Gamma]", " ", "\[Rule]", " ", "1"}]}], " ", "/.", " ", 
    RowBox[{"\[Sigma]\[Tau]", " ", "\[Rule]", " ", "1"}]}], " ", "/.", " ", 
   RowBox[{"n", " ", "\[Rule]", " ", 
    RowBox[{"Subscript", "[", 
     RowBox[{"n", ",", " ", "\[Gamma]"}], "]"}]}]}], " ", "//", " ", 
  "Quiet"}]}], "Input",
 CellChangeTimes->{{3.526761832066247*^9, 3.52676192775576*^9}, {
  3.526762297076962*^9, 3.526762299771537*^9}, {3.526762405076324*^9, 
  3.5267624185879393`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{"\[Gamma]", "\[Rule]", 
    FractionBox[
     RowBox[{
      RowBox[{"\[Mu]\[Gamma]", " ", 
       SuperscriptBox["\[Sigma]\[Tau]", "2"]}], "+", 
      RowBox[{
       SuperscriptBox["\[Sigma]\[Gamma]", "2"], " ", 
       RowBox[{
        UnderoverscriptBox["\[Sum]", 
         RowBox[{"i", "=", "1"}], "n"], 
        RowBox[{
        "\[Tau]", "\[LeftDoubleBracket]", "i", 
         "\[RightDoubleBracket]"}]}]}]}], 
     RowBox[{
      RowBox[{"n", " ", 
       SuperscriptBox["\[Sigma]\[Gamma]", "2"]}], "+", 
      SuperscriptBox["\[Sigma]\[Tau]", "2"]}]]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{{3.526761871018959*^9, 3.526761893781703*^9}, 
   3.526761930769979*^9, 3.5267623049442244`*^9, {3.526762414406302*^9, 
   3.52676242127247*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{"\[Gamma]", "\[Rule]", 
    FractionBox[
     RowBox[{
      RowBox[{"-", 
       FractionBox["1", "2"]}], "+", "k", "+", 
      RowBox[{
       UnderoverscriptBox["\[Sum]", 
        RowBox[{"i", "=", "1"}], 
        SubscriptBox["n", "\[Gamma]"]], 
       RowBox[{
       "\[Tau]", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}]}]}], 
     RowBox[{"1", "+", 
      SubscriptBox["n", "\[Gamma]"]}]]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{{3.526761871018959*^9, 3.526761893781703*^9}, 
   3.526761930769979*^9, 3.5267623049442244`*^9, {3.526762414406302*^9, 
   3.5267624212747793`*^9}}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["\[Kappa] and log\[Alpha]", "Subsection",
 CellChangeTimes->{{3.526761976097507*^9, 3.526761981570684*^9}}],

Cell["\<\
do normal SGD step for \[Kappa] after determining log\[Alpha]\
\>", "Text",
 CellChangeTimes->{{3.52676204176691*^9, 3.526762053495696*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
sparse \[Rho] and log\[Lambda] SGD approximation\
\>", "Subsection",
 CellChangeTimes->{{3.526762109922419*^9, 3.5267621149384327`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(", 
   RowBox[{
    RowBox[{"DSolve", "[", 
     RowBox[{
      RowBox[{"{", " ", 
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"log\[Lambda]", "'"}], "[", "t", "]"}], " ", "\[Equal]", 
         " ", 
         RowBox[{"\[Eta]", " ", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{"\[Tau]0", " ", "+", " ", "t"}], ")"}], "^", 
           RowBox[{"(", 
            RowBox[{"-", "\[Chi]"}], ")"}]}], " ", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{"\[Rho]", " ", "-", " ", 
             RowBox[{"log\[Lambda]", "[", "t", "]"}]}], ")"}], " ", "/", " ", 
           "\[Sigma]"}]}]}], ",", " ", 
        RowBox[{
         RowBox[{"log\[Lambda]", "[", "s", "]"}], " ", "\[Equal]", " ", 
         "log\[Lambda]s"}]}], " ", "}"}], ",", " ", 
      RowBox[{"log\[Lambda]", "[", "t", "]"}], ",", " ", "t"}], "]"}], " ", "//",
     " ", "FullSimplify"}], ")"}], " ", "/.", " ", 
  RowBox[{"log\[Lambda]s", " ", "\[Rule]", " ", 
   RowBox[{"log\[Lambda]", "[", "s", "]"}]}]}]], "Input",
 CellChangeTimes->{{3.5267625381226053`*^9, 3.526762572674986*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"log\[Lambda]", "[", "t", "]"}], "\[Rule]", 
    RowBox[{"\[Rho]", "+", 
     RowBox[{
      SuperscriptBox["\[ExponentialE]", 
       FractionBox[
        RowBox[{"\[Eta]", " ", 
         RowBox[{"(", 
          RowBox[{
           FractionBox[
            SuperscriptBox[
             RowBox[{"(", 
              RowBox[{"s", "+", "\[Tau]0"}], ")"}], 
             RowBox[{"1", "-", "\[Chi]"}]], 
            RowBox[{"1", "-", "\[Chi]"}]], "+", 
           FractionBox[
            SuperscriptBox[
             RowBox[{"(", 
              RowBox[{"t", "+", "\[Tau]0"}], ")"}], 
             RowBox[{"1", "-", "\[Chi]"}]], 
            RowBox[{
             RowBox[{"-", "1"}], "+", "\[Chi]"}]]}], ")"}]}], "\[Sigma]"]], 
      " ", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", "\[Rho]"}], "+", 
        RowBox[{"log\[Lambda]", "[", "s", "]"}]}], ")"}]}]}]}], "}"}], 
  "}"}]], "Output",
 CellChangeTimes->{3.5267625749829283`*^9, 3.526763291861526*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Solve", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"(", 
      RowBox[{
       RowBox[{"D", "[", 
        RowBox[{
         RowBox[{
          RowBox[{"Log", "[", 
           RowBox[{"PDF", "[", 
            RowBox[{
             RowBox[{"NormalDistribution", "[", 
              RowBox[{"\[Mu]\[Rho]", ",", " ", "\[Sigma]\[Rho]"}], "]"}], ",",
              " ", "\[Rho]"}], "]"}], "]"}], " ", "+", " ", 
          RowBox[{"Sum", "[", 
           RowBox[{
            RowBox[{"Log", "[", 
             RowBox[{"PDF", "[", 
              RowBox[{
               RowBox[{"NormalDistribution", "[", 
                RowBox[{"\[Rho]", ",", " ", "\[Sigma]log\[Lambda]"}], "]"}], 
               ",", " ", 
               RowBox[{"log\[Lambda]", "[", 
                RowBox[{"[", "i", "]"}], "]"}]}], "]"}], "]"}], ",", " ", 
            RowBox[{"{", " ", 
             RowBox[{"i", ",", " ", "1", ",", " ", "n"}], " ", "}"}]}], 
           "]"}]}], ",", " ", "\[Rho]"}], "]"}], " ", "//", " ", 
       "FullSimplify"}], ")"}], " ", "\[Equal]", " ", "0"}], ",", " ", 
    "\[Rho]"}], "]"}], " ", "//", " ", "Quiet"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"%", " ", "/.", " ", 
      RowBox[{"\[Mu]\[Rho]", " ", "\[Rule]", " ", "0"}]}], " ", "/.", " ", 
     RowBox[{"\[Sigma]\[Rho]", " ", "\[Rule]", " ", "1"}]}], " ", "/.", " ", 
    RowBox[{"\[Sigma]log\[Lambda]", " ", "\[Rule]", " ", "1"}]}], " ", "/.", 
   " ", 
   RowBox[{"n", " ", "\[Rule]", " ", 
    RowBox[{"Subscript", "[", 
     RowBox[{"n", ",", " ", "\[Rho]"}], "]"}]}]}], " ", "//", " ", 
  "Quiet"}]}], "Input",
 CellChangeTimes->{{3.526762157649597*^9, 3.5267623076209173`*^9}, {
  3.52676235406888*^9, 3.526762421996922*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{"\[Rho]", "\[Rule]", 
    FractionBox[
     RowBox[{
      RowBox[{"\[Mu]\[Rho]", " ", 
       SuperscriptBox["\[Sigma]log\[Lambda]", "2"]}], "+", 
      RowBox[{
       SuperscriptBox["\[Sigma]\[Rho]", "2"], " ", 
       RowBox[{
        UnderoverscriptBox["\[Sum]", 
         RowBox[{"i", "=", "1"}], "n"], 
        RowBox[{
        "log\[Lambda]", "\[LeftDoubleBracket]", "i", 
         "\[RightDoubleBracket]"}]}]}]}], 
     RowBox[{
      SuperscriptBox["\[Sigma]log\[Lambda]", "2"], "+", 
      RowBox[{"n", " ", 
       SuperscriptBox["\[Sigma]\[Rho]", "2"]}]}]]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{
  3.526762199404971*^9, 3.526762247775899*^9, {3.526762285546427*^9, 
   3.526762311157613*^9}, {3.5267623610468273`*^9, 3.5267624248223543`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{"\[Rho]", "\[Rule]", 
    FractionBox[
     RowBox[{
      UnderoverscriptBox["\[Sum]", 
       RowBox[{"i", "=", "1"}], 
       SubscriptBox["n", "\[Rho]"]], 
      RowBox[{
      "log\[Lambda]", "\[LeftDoubleBracket]", "i", 
       "\[RightDoubleBracket]"}]}], 
     RowBox[{"1", "+", 
      SubscriptBox["n", "\[Rho]"]}]]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{
  3.526762199404971*^9, 3.526762247775899*^9, {3.526762285546427*^9, 
   3.526762311157613*^9}, {3.5267623610468273`*^9, 3.526762424824078*^9}}]
}, Open  ]]
}, Open  ]]
}, Open  ]]
},
WindowSize->{640, 750},
WindowMargins->{{229, Automatic}, {Automatic, 0}},
ShowSelection->True,
FrontEndVersion->"7.0 for Mac OS X x86 (32-bit) (February 18, 2009)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[567, 22, 118, 1, 67, "Section"],
Cell[CellGroupData[{
Cell[710, 27, 100, 1, 34, "Subsection"],
Cell[813, 30, 8427, 230, 478, "Input"],
Cell[CellGroupData[{
Cell[9265, 264, 2152, 56, 88, "Input"],
Cell[11420, 322, 7717, 194, 378, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[19186, 522, 96, 1, 26, "Subsection"],
Cell[19285, 525, 4942, 112, 358, "Input"],
Cell[CellGroupData[{
Cell[24252, 641, 264, 3, 24, "Subsubsection"],
Cell[CellGroupData[{
Cell[24541, 648, 8795, 196, 433, "Input"],
Cell[33339, 846, 18926, 452, 1178, "Output"]
}, Open  ]]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[52326, 1305, 165, 2, 26, "Subsection"],
Cell[52494, 1309, 4483, 96, 313, "Input"],
Cell[CellGroupData[{
Cell[57002, 1409, 310, 4, 24, "Subsubsection"],
Cell[CellGroupData[{
Cell[57337, 1417, 11846, 260, 703, "Input"],
Cell[69186, 1679, 19674, 471, 1063, "Output"]
}, Open  ]]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[88921, 2157, 320, 4, 27, "Subsection"],
Cell[89244, 2163, 5725, 146, 343, "Input"],
Cell[CellGroupData[{
Cell[94994, 2313, 357, 5, 24, "Subsubsection"],
Cell[CellGroupData[{
Cell[95376, 2322, 11790, 258, 703, "Input"],
Cell[107169, 2582, 13832, 321, 718, "Output"]
}, Open  ]]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[121062, 2910, 301, 4, 27, "Subsection"],
Cell[121366, 2916, 2061, 45, 163, "Input"],
Cell[CellGroupData[{
Cell[123452, 2965, 358, 5, 24, "Subsubsection"],
Cell[CellGroupData[{
Cell[123835, 2974, 8638, 188, 508, "Input"],
Cell[132476, 3164, 1615, 27, 140, "Message"],
Cell[134094, 3193, 1615, 27, 140, "Message"],
Cell[135712, 3222, 1613, 27, 140, "Message"],
Cell[137328, 3251, 710, 12, 41, "Message"],
Cell[138041, 3265, 20035, 482, 1063, "Output"]
}, Open  ]]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[158137, 3754, 359, 5, 27, "Subsection"],
Cell[158499, 3761, 6058, 135, 358, "Input"],
Cell[CellGroupData[{
Cell[164582, 3900, 405, 5, 24, "Subsubsection"],
Cell[CellGroupData[{
Cell[165012, 3909, 9805, 214, 523, "Input"],
Cell[174820, 4125, 1636, 27, 134, "Message"],
Cell[176459, 4154, 1634, 27, 134, "Message"],
Cell[178096, 4183, 1634, 27, 133, "Message"],
Cell[179733, 4212, 907, 15, 41, "Message"],
Cell[180643, 4229, 13891, 332, 773, "Output"]
}, Open  ]]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[194595, 4568, 189, 4, 26, "Subsection"],
Cell[CellGroupData[{
Cell[194809, 4576, 1091, 29, 43, "Input"],
Cell[195903, 4607, 1001, 30, 54, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[196941, 4642, 1915, 48, 103, "Input"],
Cell[198859, 4692, 808, 22, 53, "Output"],
Cell[199670, 4716, 658, 18, 62, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[200377, 4740, 112, 1, 35, "Subsection"],
Cell[200492, 4743, 150, 3, 26, "Text"]
}, Open  ]],
Cell[CellGroupData[{
Cell[200679, 4751, 146, 3, 35, "Subsection"],
Cell[CellGroupData[{
Cell[200850, 4758, 1141, 30, 58, "Input"],
Cell[201994, 4790, 1036, 31, 63, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[203067, 4826, 1773, 45, 103, "Input"],
Cell[204843, 4873, 820, 22, 54, "Output"],
Cell[205666, 4897, 573, 16, 59, "Output"]
}, Open  ]]
}, Open  ]]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
